Class AdvancedPermissionChecker
Object
com.liferay.portal.security.permission.BasePermissionChecker
com.liferay.portal.security.permission.AdvancedPermissionChecker
- All Implemented Interfaces:
com.liferay.portal.kernel.security.permission.PermissionChecker
,Cloneable
- Author:
- Charles May, Brian Wing Shun Chan, Raymond Augé, Wesley Gong, Connor McKay
-
Field Summary
Fields inherited from class com.liferay.portal.security.permission.BasePermissionChecker
checkGuest, guestUserId, omniadmin, ownerRole, signedIn, user
Fields inherited from interface com.liferay.portal.kernel.security.permission.PermissionChecker
DEFAULT_ROLE_IDS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addTeamRoles
(long userId, com.liferay.portal.kernel.model.Group group, Set<Long> roleIds) clone()
protected boolean
doCheckPermission
(long companyId, long groupId, String name, String primKey, long[] roleIds, String actionId, org.apache.commons.lang.time.StopWatch stopWatch) protected long[]
doGetRoleIds
(long userId, long groupId) protected List<com.liferay.portal.kernel.model.Resource>
fixMissingResources
(long companyId, long groupId, String name, String primKey, String actionId, List<com.liferay.portal.kernel.model.Resource> resources) long[]
protected List<com.liferay.portal.kernel.model.Resource>
getResources
(long companyId, long groupId, String name, String primKey, String actionId) Returns representations of the resource at each scope level.long[]
getRoleIds
(long userId, long groupId) com.liferay.portal.kernel.security.permission.UserBag
boolean
hasOwnerPermission
(long companyId, String name, String primKey, long ownerId, String actionId) boolean
hasPermission
(com.liferay.portal.kernel.model.Group group, String name, String primKey, String actionId) void
init
(com.liferay.portal.kernel.model.User user, com.liferay.portal.kernel.security.permission.contributor.RoleContributor[] roleContributors) boolean
boolean
isCompanyAdmin
(long companyId) protected boolean
isCompanyAdminImpl
(long companyId) boolean
isContentReviewer
(long companyId, long groupId) protected boolean
isContentReviewerImpl
(long groupId) protected boolean
isContentReviewerImpl
(long companyId, long groupId) boolean
isGroupAdmin
(long groupId) protected boolean
isGroupAdminImpl
(com.liferay.portal.kernel.model.Group group) boolean
isGroupMember
(long groupId) protected boolean
isGroupMemberImpl
(long groupId) boolean
isGroupOwner
(long groupId) protected boolean
isGroupOwnerImpl
(long groupId) protected boolean
isGroupOwnerImpl
(com.liferay.portal.kernel.model.Group group) boolean
isOrganizationAdmin
(long organizationId) protected boolean
isOrganizationAdminImpl
(long organizationId) protected boolean
isOrganizationAdminImpl
(com.liferay.portal.kernel.model.Organization organization) boolean
isOrganizationOwner
(long organizationId) protected boolean
isOrganizationOwnerImpl
(long organizationId) protected boolean
isOrganizationOwnerImpl
(com.liferay.portal.kernel.model.Organization organization) protected void
logHasUserPermission
(long groupId, String name, String primKey, String actionId, org.apache.commons.lang.time.StopWatch stopWatch, int block) Methods inherited from class com.liferay.portal.security.permission.BasePermissionChecker
getCompanyId, getOwnerRoleId, getPermissionChecksMap, getUser, getUserId, hasOwnerPermission, hasPermission, hasPermission, hasPermission, init, isCheckGuest, isOmniadmin, isSignedIn
-
Constructor Details
-
AdvancedPermissionChecker
public AdvancedPermissionChecker()
-
-
Method Details
-
clone
- Specified by:
clone
in interfacecom.liferay.portal.kernel.security.permission.PermissionChecker
- Specified by:
clone
in classBasePermissionChecker
-
getGuestUserRoleIds
public long[] getGuestUserRoleIds()- Specified by:
getGuestUserRoleIds
in interfacecom.liferay.portal.kernel.security.permission.PermissionChecker
- Overrides:
getGuestUserRoleIds
in classBasePermissionChecker
-
getRoleIds
public long[] getRoleIds(long userId, long groupId) - Specified by:
getRoleIds
in interfacecom.liferay.portal.kernel.security.permission.PermissionChecker
- Overrides:
getRoleIds
in classBasePermissionChecker
-
getUserBag
public com.liferay.portal.kernel.security.permission.UserBag getUserBag() throws com.liferay.portal.kernel.exception.PortalException- Throws:
com.liferay.portal.kernel.exception.PortalException
-
hasOwnerPermission
-
hasPermission
-
init
public void init(com.liferay.portal.kernel.model.User user, com.liferay.portal.kernel.security.permission.contributor.RoleContributor[] roleContributors) -
isCompanyAdmin
public boolean isCompanyAdmin() -
isCompanyAdmin
public boolean isCompanyAdmin(long companyId) -
isContentReviewer
public boolean isContentReviewer(long companyId, long groupId) -
isGroupAdmin
public boolean isGroupAdmin(long groupId) -
isGroupMember
public boolean isGroupMember(long groupId) -
isGroupOwner
public boolean isGroupOwner(long groupId) -
isOrganizationAdmin
public boolean isOrganizationAdmin(long organizationId) -
isOrganizationOwner
public boolean isOrganizationOwner(long organizationId) -
addTeamRoles
protected void addTeamRoles(long userId, com.liferay.portal.kernel.model.Group group, Set<Long> roleIds) throws Exception - Throws:
Exception
-
doCheckPermission
protected boolean doCheckPermission(long companyId, long groupId, String name, String primKey, long[] roleIds, String actionId, org.apache.commons.lang.time.StopWatch stopWatch) throws Exception - Throws:
Exception
-
doGetRoleIds
- Throws:
Exception
-
fixMissingResources
protected List<com.liferay.portal.kernel.model.Resource> fixMissingResources(long companyId, long groupId, String name, String primKey, String actionId, List<com.liferay.portal.kernel.model.Resource> resources) throws Exception - Throws:
Exception
-
getResources
protected List<com.liferay.portal.kernel.model.Resource> getResources(long companyId, long groupId, String name, String primKey, String actionId) throws Exception Returns representations of the resource at each scope level.For example, if the class name and primary key of a blog entry were passed to this method, it would return a resource for the blog entry itself (individual scope), a resource representing all blog entries within its group (group scope), a resource standing for all blog entries within a group the user has a suitable role in (group-template scope), and a resource signifying all blog entries within the company (company scope).
- Parameters:
companyId
- the primary key of the companygroupId
- the primary key of the group containing the resourcename
- the resource's name, which can be either a class name or a portlet IDprimKey
- the primary key of the resourceactionId
- unused- Returns:
- representations of the resource at each scope level
- Throws:
Exception
- if an exception occurred
-
isCompanyAdminImpl
- Throws:
Exception
-
isContentReviewerImpl
protected boolean isContentReviewerImpl(long groupId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
isContentReviewerImpl
- Throws:
Exception
-
isGroupAdminImpl
- Throws:
Exception
-
isGroupMemberImpl
- Throws:
Exception
-
isGroupOwnerImpl
protected boolean isGroupOwnerImpl(com.liferay.portal.kernel.model.Group group) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
isGroupOwnerImpl
- Throws:
Exception
-
isOrganizationAdminImpl
- Throws:
Exception
-
isOrganizationAdminImpl
protected boolean isOrganizationAdminImpl(com.liferay.portal.kernel.model.Organization organization) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
isOrganizationOwnerImpl
- Throws:
Exception
-
isOrganizationOwnerImpl
protected boolean isOrganizationOwnerImpl(com.liferay.portal.kernel.model.Organization organization) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
logHasUserPermission
-