001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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    }