public class PermissionCheckerWrapper extends Object implements PermissionChecker
DEFAULT_ROLE_IDS| Constructor and Description |
|---|
PermissionCheckerWrapper(PermissionChecker permissionChecker) |
| Modifier and Type | Method and Description |
|---|---|
PermissionChecker |
clone() |
long |
getCompanyId()
Returns the primary key of the user's company.
|
long[] |
getGuestUserRoleIds() |
long |
getOwnerRoleId()
Returns the primary key of the owner role.
|
Map<Object,Object> |
getPermissionChecksMap() |
long[] |
getRoleIds(long userId,
long groupId)
Returns the primary keys of the roles the user has within the group.
|
User |
getUser() |
UserBag |
getUserBag() |
long |
getUserId()
Returns the primary key of the user.
|
boolean |
hasOwnerPermission(long companyId,
String name,
long primKey,
long ownerId,
String actionId)
Returns
true if the user is the owner of the resource and
has permission to perform the action. |
boolean |
hasOwnerPermission(long companyId,
String name,
String primKey,
long ownerId,
String actionId)
Returns
true if the user is the owner of the resource and
has permission to perform the action. |
boolean |
hasPermission(Group group,
String name,
long primKey,
String actionId) |
boolean |
hasPermission(Group group,
String name,
String primKey,
String actionId) |
boolean |
hasPermission(long groupId,
String name,
long primKey,
String actionId)
Returns
true if the user has permission to perform the
action on the resource. |
boolean |
hasPermission(long groupId,
String name,
String primKey,
String actionId)
Returns
true if the user has permission to perform the
action on the resource. |
void |
init(User user)
Initializes this permission checker.
|
void |
init(User user,
RoleContributor[] roleContributors) |
boolean |
isCheckGuest()
Returns
true if guest permissions will be used in permission
checks. |
boolean |
isCompanyAdmin()
Returns
true if the user is an administrator of their
company. |
boolean |
isCompanyAdmin(long companyId)
Returns
true if the user is an administrator of the company. |
boolean |
isContentReviewer(long companyId,
long groupId)
Returns
true if the user is a content reviewer or has
sufficient permissions to review content (i.e. the user is a company or
group administrator). |
boolean |
isGroupAdmin(long groupId)
Returns
true if the user is an administrator of the group. |
boolean |
isGroupMember(long groupId)
Returns
true if the user is a member of the group. |
boolean |
isGroupOwner(long groupId)
Returns
true if the user is the owner of the group. |
boolean |
isOmniadmin()
Returns
true if the user is a universal administrator. |
boolean |
isOrganizationAdmin(long organizationId)
Returns
true if the user is an administrator of the
organization. |
boolean |
isOrganizationOwner(long organizationId)
Returns
true if the user is an owner of the organization. |
boolean |
isSignedIn()
Returns
true if the user is signed in. |
public PermissionCheckerWrapper(PermissionChecker permissionChecker)
public final PermissionChecker clone()
clone in interface PermissionCheckerclone in class Objectpublic long getCompanyId()
PermissionCheckergetCompanyId in interface PermissionCheckerpublic long[] getGuestUserRoleIds()
getGuestUserRoleIds in interface PermissionCheckerpublic long getOwnerRoleId()
PermissionCheckergetOwnerRoleId in interface PermissionCheckerpublic Map<Object,Object> getPermissionChecksMap()
getPermissionChecksMap in interface PermissionCheckerpublic long[] getRoleIds(long userId,
long groupId)
PermissionCheckergetRoleIds in interface PermissionCheckeruserId - the primary key of the usergroupId - the primary key of the grouppublic User getUser()
getUser in interface PermissionCheckerpublic UserBag getUserBag() throws Exception
getUserBag in interface PermissionCheckerExceptionpublic long getUserId()
PermissionCheckergetUserId in interface PermissionCheckerpublic boolean hasOwnerPermission(long companyId,
String name,
long primKey,
long ownerId,
String actionId)
PermissionCheckertrue if the user is the owner of the resource and
has permission to perform the action.hasOwnerPermission in interface PermissionCheckercompanyId - 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 IDtrue if the user is the owner of the resource and
has permission to perform the action; false
otherwisepublic boolean hasOwnerPermission(long companyId,
String name,
String primKey,
long ownerId,
String actionId)
PermissionCheckertrue if the user is the owner of the resource and
has permission to perform the action.hasOwnerPermission in interface PermissionCheckercompanyId - 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 IDtrue if the user is the owner of the resource and
has permission to perform the action; false
otherwisepublic boolean hasPermission(Group group, String name, long primKey, String actionId)
hasPermission in interface PermissionCheckerpublic boolean hasPermission(Group group, String name, String primKey, String actionId)
hasPermission in interface PermissionCheckerpublic boolean hasPermission(long groupId,
String name,
long primKey,
String actionId)
PermissionCheckertrue if the user has permission to perform the
action on the resource.hasPermission in interface PermissionCheckergroupId - 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 IDtrue if the user has permission to perform the
action on the resource; false otherwisepublic boolean hasPermission(long groupId,
String name,
String primKey,
String actionId)
PermissionCheckertrue if the user has permission to perform the
action on the resource.hasPermission in interface PermissionCheckergroupId - 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 IDtrue if the user has permission to perform the
action on the resource; false otherwisepublic final void init(User user)
PermissionCheckerinit in interface PermissionCheckeruser - the current userpublic final void init(User user, RoleContributor[] roleContributors)
init in interface PermissionCheckerpublic boolean isCheckGuest()
PermissionCheckertrue if guest permissions will be used in permission
checks.isCheckGuest in interface PermissionCheckertrue if guest permissions will be used in permission
checks; false otherwisepublic boolean isCompanyAdmin()
PermissionCheckertrue if the user is an administrator of their
company.isCompanyAdmin in interface PermissionCheckertrue if the user is an administrator of their
company; false otherwisepublic boolean isCompanyAdmin(long companyId)
PermissionCheckertrue if the user is an administrator of the company.isCompanyAdmin in interface PermissionCheckercompanyId - the primary key of the companytrue if the user is an administrator of the company;
false otherwisepublic boolean isContentReviewer(long companyId,
long groupId)
PermissionCheckertrue if the user is a content reviewer or has
sufficient permissions to review content (i.e. the user is a company or
group administrator).isContentReviewer in interface PermissionCheckercompanyId - the primary key of the companygroupId - the primary key of the grouptrue if the user is a reviewer or has sufficient
permissions to review content; false otherwisepublic boolean isGroupAdmin(long groupId)
PermissionCheckertrue if the user is an administrator of the group.isGroupAdmin in interface PermissionCheckergroupId - the primary key of the grouptrue if the user is an administrator of the group;
false otherwisepublic boolean isGroupMember(long groupId)
PermissionCheckertrue if the user is a member of the group.isGroupMember in interface PermissionCheckergroupId - the primary key of the grouptrue if the user is a member of the group;
false otherwisepublic boolean isGroupOwner(long groupId)
PermissionCheckertrue if the user is the owner of the group.isGroupOwner in interface PermissionCheckergroupId - the primary key of the grouptrue if the user is the owner of the group;
false otherwisepublic boolean isOmniadmin()
PermissionCheckertrue if the user is a universal administrator.isOmniadmin in interface PermissionCheckertrue if the user is a universal administrator;
false otherwiseOmniadminUtilpublic boolean isOrganizationAdmin(long organizationId)
PermissionCheckertrue if the user is an administrator of the
organization.isOrganizationAdmin in interface PermissionCheckerorganizationId - the primary key of the organizationtrue if the user is an administrator of the
organization; false otherwisepublic boolean isOrganizationOwner(long organizationId)
PermissionCheckertrue if the user is an owner of the organization.isOrganizationOwner in interface PermissionCheckerorganizationId - the primary key of the organizationtrue if the user is an owner of the organization;
false otherwisepublic boolean isSignedIn()
PermissionCheckertrue if the user is signed in.isSignedIn in interface PermissionCheckertrue if the user is signed in; false
otherwise