001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service.permission;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.model.Group;
020    import com.liferay.portal.model.Organization;
021    import com.liferay.portal.model.Role;
022    import com.liferay.portal.model.User;
023    import com.liferay.portal.security.auth.PrincipalException;
024    import com.liferay.portal.security.permission.PermissionChecker;
025    
026    /**
027     * @author Charles May
028     */
029    public interface UserPermission {
030    
031            /**
032             * @deprecated
033             */
034            public void check(
035                            PermissionChecker permissionChecker, long userId,
036                            long organizationId, long locationId, String actionId)
037                    throws PrincipalException;
038    
039            public void check(
040                            PermissionChecker permissionChecker, long userId,
041                            long[] organizationIds, String actionId)
042                    throws PrincipalException;
043    
044            public void check(
045                            PermissionChecker permissionChecker, long userId, String actionId)
046                    throws PrincipalException;
047    
048            /**
049             * @deprecated
050             */
051            public boolean contains(
052                    PermissionChecker permissionChecker, long userId, long organizationId,
053                    long locationId, String actionId);
054    
055            public boolean contains(
056                    PermissionChecker permissionChecker, long userId,
057                    long[] organizationIds, String actionId);
058    
059            public boolean contains(
060                    PermissionChecker permissionChecker, long userId, String actionId);
061    
062            public boolean hasMembershipProtected(
063                            PermissionChecker permissionChecker, Group group, Role role,
064                            User user)
065                    throws PortalException, SystemException;
066    
067            public boolean hasMembershipProtected(
068                            PermissionChecker permissionChecker, Group group, User user)
069                    throws PortalException, SystemException;
070    
071            public boolean hasMembershipProtected(
072                            PermissionChecker permissionChecker, Organization organization,
073                            Role role, User user)
074                    throws SystemException;
075    
076            public boolean hasMembershipProtected(
077                            PermissionChecker permissionChecker, Organization organization,
078                            User user)
079                    throws PortalException, SystemException;
080    
081    }