@ProviderType
public interface PermissionChecker
extends Cloneable
Modifier and Type | Field and Description |
---|---|
static long[] |
DEFAULT_ROLE_IDS |
Modifier and Type | Method and Description |
---|---|
PermissionChecker |
clone() |
long |
getCompanyId()
Returns the primary key of the user's company.
|
long[] |
getGuestUserRoleIds() |
List<Long> |
getOwnerResourceBlockIds(long companyId,
long groupId,
String name,
String actionId) |
long |
getOwnerRoleId()
Returns the primary key of the owner role.
|
Map<Object,Object> |
getPermissionChecksMap() |
List<Long> |
getResourceBlockIds(long companyId,
long groupId,
long userId,
String name,
String actionId) |
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.
|
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. |
PermissionChecker clone()
long getCompanyId()
long[] getGuestUserRoleIds()
List<Long> getOwnerResourceBlockIds(long companyId, long groupId, String name, String actionId)
long getOwnerRoleId()
Map<Object,Object> getPermissionChecksMap()
List<Long> getResourceBlockIds(long companyId, long groupId, long userId, String name, String actionId)
long[] getRoleIds(long userId, long groupId)
userId
- the primary key of the usergroupId
- the primary key of the groupUser getUser()
UserBag getUserBag() throws Exception
Exception
long getUserId()
boolean hasOwnerPermission(long companyId, String name, long primKey, long ownerId, String actionId)
true
if the user is the owner of the resource and
has permission to perform the action.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 IDtrue
if the user is the owner of the resource and
has permission to perform the action; false
otherwiseboolean hasOwnerPermission(long companyId, String name, String primKey, long ownerId, String actionId)
true
if the user is the owner of the resource and
has permission to perform the action.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 IDtrue
if the user is the owner of the resource and
has permission to perform the action; false
otherwiseboolean 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)
true
if the user has permission to perform the
action on the resource.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 IDtrue
if the user has permission to perform the
action on the resource; false
otherwiseboolean hasPermission(long groupId, String name, String primKey, String actionId)
true
if the user has permission to perform the
action on the resource.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 IDtrue
if the user has permission to perform the
action on the resource; false
otherwisevoid init(User user)
user
- the current userboolean isCheckGuest()
true
if guest permissions will be used in permission
checks.true
if guest permissions will be used in permission
checks; false
otherwiseboolean isCompanyAdmin()
true
if the user is an administrator of their
company.true
if the user is an administrator of their
company; false
otherwiseboolean isCompanyAdmin(long companyId)
true
if the user is an administrator of the company.companyId
- the primary key of the companytrue
if the user is an administrator of the company;
false
otherwiseboolean isContentReviewer(long companyId, long groupId)
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).companyId
- 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
otherwiseboolean isGroupAdmin(long groupId)
true
if the user is an administrator of the group.groupId
- the primary key of the grouptrue
if the user is an administrator of the group;
false
otherwiseboolean isGroupMember(long groupId)
true
if the user is a member of the group.groupId
- the primary key of the grouptrue
if the user is a member of the group;
false
otherwiseboolean isGroupOwner(long groupId)
true
if the user is the owner of the group.groupId
- the primary key of the grouptrue
if the user is the owner of the group;
false
otherwiseboolean isOmniadmin()
true
if the user is a universal administrator.true
if the user is a universal administrator;
false
otherwiseOmniadminUtil
boolean isOrganizationAdmin(long organizationId)
true
if the user is an administrator of the
organization.organizationId
- the primary key of the organizationtrue
if the user is an administrator of the
organization; false
otherwiseboolean isOrganizationOwner(long organizationId)
true
if the user is an owner of the organization.organizationId
- the primary key of the organizationtrue
if the user is an owner of the organization;
false
otherwiseboolean isSignedIn()
true
if the user is signed in.true
if the user is signed in; false
otherwise