Class PermissionCheckerWrapper
Object
com.liferay.portal.kernel.security.permission.wrapper.PermissionCheckerWrapper
- All Implemented Interfaces:
PermissionChecker,Cloneable
- Author:
- Preston Crary
-
Field Summary
Fields inherited from interface com.liferay.portal.kernel.security.permission.PermissionChecker
DEFAULT_ROLE_IDS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal PermissionCheckerclone()longReturns the primary key of the user's company.long[]longReturns the primary key of the owner role.long[]getRoleIds(long userId, long groupId) Returns the primary keys of the roles the user has within the group.getUser()longReturns the primary key of the user.booleanhasOwnerPermission(long companyId, String name, long primKey, long ownerId, String actionId) Returnstrueif the user is the owner of the resource and has permission to perform the action.booleanhasOwnerPermission(long companyId, String name, String primKey, long ownerId, String actionId) Returnstrueif the user is the owner of the resource and has permission to perform the action.booleanhasPermission(long groupId, String name, long primKey, String actionId) Returnstrueif the user has permission to perform the action on the resource.booleanhasPermission(long groupId, String name, String primKey, String actionId) Returnstrueif the user has permission to perform the action on the resource.booleanhasPermission(Group group, String name, long primKey, String actionId) booleanhasPermission(Group group, String name, String primKey, String actionId) final voidInitializes this permission checker.final voidinit(User user, RoleContributor[] roleContributors) booleanReturnstrueif guest permissions will be used in permission checks.booleanReturnstrueif the user is an administrator of their company.booleanisCompanyAdmin(long companyId) Returnstrueif the user is an administrator of the company.booleanisContentReviewer(long companyId, long groupId) Returnstrueif the user is a content reviewer or has sufficient permissions to review content (i.e. the user is a company or group administrator).booleanisGroupAdmin(long groupId) Returnstrueif the user is an administrator of the group.booleanisGroupMember(long groupId) Returnstrueif the user is a member of the group.booleanisGroupOwner(long groupId) Returnstrueif the user is the owner of the group.booleanReturnstrueif the user is a universal administrator.booleanisOrganizationAdmin(long organizationId) Returnstrueif the user is an administrator of the organization.booleanisOrganizationOwner(long organizationId) Returnstrueif the user is an owner of the organization.booleanReturnstrueif the user is signed in.
-
Constructor Details
-
PermissionCheckerWrapper
-
-
Method Details
-
clone
- Specified by:
clonein interfacePermissionChecker- Overrides:
clonein classObject
-
getCompanyId
public long getCompanyId()Description copied from interface:PermissionCheckerReturns the primary key of the user's company.- Specified by:
getCompanyIdin interfacePermissionChecker- Returns:
- the primary key of the user's company
-
getGuestUserRoleIds
public long[] getGuestUserRoleIds()- Specified by:
getGuestUserRoleIdsin interfacePermissionChecker
-
getOwnerRoleId
public long getOwnerRoleId()Description copied from interface:PermissionCheckerReturns the primary key of the owner role. This role is automatically given to the creator of a resource.- Specified by:
getOwnerRoleIdin interfacePermissionChecker- Returns:
- the primary key of the owner role
-
getPermissionChecksMap
- Specified by:
getPermissionChecksMapin interfacePermissionChecker
-
getRoleIds
public long[] getRoleIds(long userId, long groupId) Description copied from interface:PermissionCheckerReturns the primary keys of the roles the user has within the group.- Specified by:
getRoleIdsin interfacePermissionChecker- Parameters:
userId- the primary key of the usergroupId- the primary key of the group- Returns:
- the primary keys of the roles the user has within the group
-
getUser
- Specified by:
getUserin interfacePermissionChecker
-
getUserBag
- Specified by:
getUserBagin interfacePermissionChecker- Throws:
Exception
-
getUserId
public long getUserId()Description copied from interface:PermissionCheckerReturns the primary key of the user.- Specified by:
getUserIdin interfacePermissionChecker- Returns:
- the primary key of the user
-
hasOwnerPermission
public boolean hasOwnerPermission(long companyId, String name, long primKey, long ownerId, String actionId) Description copied from interface:PermissionCheckerReturnstrueif the user is the owner of the resource and has permission to perform the action.- Specified by:
hasOwnerPermissionin interfacePermissionChecker- Parameters:
companyId- the primary key of the user's companyname- the resource's name, which can be either a class name or a portlet IDprimKey- the primary key of the resourceownerId- the primary key of the resource's owneractionId- the action ID- Returns:
trueif the user is the owner of the resource and has permission to perform the action;falseotherwise
-
hasOwnerPermission
public boolean hasOwnerPermission(long companyId, String name, String primKey, long ownerId, String actionId) Description copied from interface:PermissionCheckerReturnstrueif the user is the owner of the resource and has permission to perform the action.- Specified by:
hasOwnerPermissionin interfacePermissionChecker- Parameters:
companyId- the primary key of the user's companyname- the resource's name, which can be either a class name or a portlet IDprimKey- the primary key of the resourceownerId- the primary key of the resource's owneractionId- the action ID- Returns:
trueif the user is the owner of the resource and has permission to perform the action;falseotherwise
-
hasPermission
- Specified by:
hasPermissionin interfacePermissionChecker
-
hasPermission
- Specified by:
hasPermissionin interfacePermissionChecker
-
hasPermission
Description copied from interface:PermissionCheckerReturnstrueif the user has permission to perform the action on the resource.- Specified by:
hasPermissionin interfacePermissionChecker- Parameters:
groupId- 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- the action ID- Returns:
trueif the user has permission to perform the action on the resource;falseotherwise
-
hasPermission
Description copied from interface:PermissionCheckerReturnstrueif the user has permission to perform the action on the resource.- Specified by:
hasPermissionin interfacePermissionChecker- Parameters:
groupId- 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- the action ID- Returns:
trueif the user has permission to perform the action on the resource;falseotherwise
-
init
Description copied from interface:PermissionCheckerInitializes this permission checker.- Specified by:
initin interfacePermissionChecker- Parameters:
user- the current user
-
init
- Specified by:
initin interfacePermissionChecker
-
isCheckGuest
public boolean isCheckGuest()Description copied from interface:PermissionCheckerReturnstrueif guest permissions will be used in permission checks.- Specified by:
isCheckGuestin interfacePermissionChecker- Returns:
trueif guest permissions will be used in permission checks;falseotherwise
-
isCompanyAdmin
public boolean isCompanyAdmin()Description copied from interface:PermissionCheckerReturnstrueif the user is an administrator of their company.- Specified by:
isCompanyAdminin interfacePermissionChecker- Returns:
trueif the user is an administrator of their company;falseotherwise
-
isCompanyAdmin
public boolean isCompanyAdmin(long companyId) Description copied from interface:PermissionCheckerReturnstrueif the user is an administrator of the company.- Specified by:
isCompanyAdminin interfacePermissionChecker- Parameters:
companyId- the primary key of the company- Returns:
trueif the user is an administrator of the company;falseotherwise
-
isContentReviewer
public boolean isContentReviewer(long companyId, long groupId) Description copied from interface:PermissionCheckerReturnstrueif the user is a content reviewer or has sufficient permissions to review content (i.e. the user is a company or group administrator).- Specified by:
isContentReviewerin interfacePermissionChecker- Parameters:
companyId- the primary key of the companygroupId- the primary key of the group- Returns:
trueif the user is a reviewer or has sufficient permissions to review content;falseotherwise
-
isGroupAdmin
public boolean isGroupAdmin(long groupId) Description copied from interface:PermissionCheckerReturnstrueif the user is an administrator of the group.- Specified by:
isGroupAdminin interfacePermissionChecker- Parameters:
groupId- the primary key of the group- Returns:
trueif the user is an administrator of the group;falseotherwise
-
isGroupMember
public boolean isGroupMember(long groupId) Description copied from interface:PermissionCheckerReturnstrueif the user is a member of the group.- Specified by:
isGroupMemberin interfacePermissionChecker- Parameters:
groupId- the primary key of the group- Returns:
trueif the user is a member of the group;falseotherwise
-
isGroupOwner
public boolean isGroupOwner(long groupId) Description copied from interface:PermissionCheckerReturnstrueif the user is the owner of the group.- Specified by:
isGroupOwnerin interfacePermissionChecker- Parameters:
groupId- the primary key of the group- Returns:
trueif the user is the owner of the group;falseotherwise
-
isOmniadmin
public boolean isOmniadmin()Description copied from interface:PermissionCheckerReturnstrueif the user is a universal administrator.- Specified by:
isOmniadminin interfacePermissionChecker- Returns:
trueif the user is a universal administrator;falseotherwise- See Also:
-
OmniadminUtil
-
isOrganizationAdmin
public boolean isOrganizationAdmin(long organizationId) Description copied from interface:PermissionCheckerReturnstrueif the user is an administrator of the organization.- Specified by:
isOrganizationAdminin interfacePermissionChecker- Parameters:
organizationId- the primary key of the organization- Returns:
trueif the user is an administrator of the organization;falseotherwise
-
isOrganizationOwner
public boolean isOrganizationOwner(long organizationId) Description copied from interface:PermissionCheckerReturnstrueif the user is an owner of the organization.- Specified by:
isOrganizationOwnerin interfacePermissionChecker- Parameters:
organizationId- the primary key of the organization- Returns:
trueif the user is an owner of the organization;falseotherwise
-
isSignedIn
public boolean isSignedIn()Description copied from interface:PermissionCheckerReturnstrueif the user is signed in.- Specified by:
isSignedInin interfacePermissionChecker- Returns:
trueif the user is signed in;falseotherwise
-