Interface GroupPermissionEvaluator
public interface GroupPermissionEvaluator
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canList()
Returnstrue
if the caller has at least one ofAdminRoles.QUERY_GROUPS
,AdminRoles.MANAGE_USERS
orAdminRoles.VIEW_USERS
roles.boolean
Returnstrue
if the caller hasAdminRoles.MANAGE_USERS
role.boolean
canManage
(GroupModel group) Returnstrue
if the caller hasAdminRoles.MANAGE_USERS
role.boolean
canManageMembers
(GroupModel group) boolean
canManageMembership
(GroupModel group) Returnstrue
if the caller has one ofAdminRoles.MANAGE_USERS
role.boolean
canView()
boolean
canView
(GroupModel group) boolean
canViewMembers
(GroupModel group) getAccess
(GroupModel group) Returns Map with information what access the caller for the provided group has.IfUserPermissionEvaluator.canView()
evaluates totrue
, returns empty set.void
Throws ForbiddenException ifcanList()
returnsfalse
.void
Throws ForbiddenException ifcanManage()
returnsfalse
.void
requireManage
(GroupModel group) Throws ForbiddenException ifcanManage(GroupModel)
returnsfalse
.void
requireManageMembers
(GroupModel group) Throws ForbiddenException ifcanManageMembership(GroupModel)
returnsfalse
.void
Throws ForbiddenException ifcanManageMembership(GroupModel)
returnsfalse
.void
Throws ForbiddenException ifcanView()
returnsfalse
.void
requireView
(GroupModel group) Throws ForbiddenException ifcanView(GroupModel)
returnsfalse
.void
requireViewMembers
(GroupModel group) Throws ForbiddenException ifcanViewMembers(GroupModel)
returnsfalse
.
-
Method Details
-
canList
boolean canList()Returnstrue
if the caller has at least one ofAdminRoles.QUERY_GROUPS
,AdminRoles.MANAGE_USERS
orAdminRoles.VIEW_USERS
roles. For V2 only: Also if it has a permission toAdminPermissionsSchema.VIEW
orAdminPermissionsSchema.MANAGE
groups. -
requireList
void requireList()Throws ForbiddenException ifcanList()
returnsfalse
. -
canManage
Returnstrue
if the caller hasAdminRoles.MANAGE_USERS
role. Or if it has a permission toAdminPermissionsSchema.MANAGE
the group. -
requireManage
Throws ForbiddenException ifcanManage(GroupModel)
returnsfalse
. -
canView
Returnstrue
if the caller has one ofAdminRoles.MANAGE_USERS
orAdminRoles.VIEW_USERS
roles. Or if it has a permission toAdminPermissionsSchema.VIEW
orAdminPermissionsSchema.MANAGE
the group. -
requireView
Throws ForbiddenException ifcanView(GroupModel)
returnsfalse
. -
canManage
boolean canManage()Returnstrue
if the caller hasAdminRoles.MANAGE_USERS
role. For V2 only: Also if it has permission toAdminPermissionsSchema.VIEW
orAdminPermissionsSchema.MANAGE
groups. -
requireManage
void requireManage()Throws ForbiddenException ifcanManage()
returnsfalse
. -
canView
boolean canView()Returnstrue
if the caller has one ofAdminRoles.MANAGE_USERS
orAdminRoles.VIEW_USERS
roles. Or if it has a permission toAdminPermissionsSchema.VIEW
orAdminPermissionsSchema.MANAGE
groups. -
requireView
void requireView()Throws ForbiddenException ifcanView()
returnsfalse
. -
requireViewMembers
Throws ForbiddenException ifcanViewMembers(GroupModel)
returnsfalse
. -
canManageMembers
Returnstrue
ifUserPermissionEvaluator.canManage()
evaluates totrue
. Or if it has a permission toAdminPermissionsSchema.MANAGE_MEMBERS
of the group. -
canManageMembership
Returnstrue
if the caller has one ofAdminRoles.MANAGE_USERS
role. Or if it has a permission toAdminPermissionsSchema.MANAGE
the group orAdminPermissionsSchema.MANAGE_MEMBERSHIP
of the group. -
canViewMembers
Returnstrue
ifUserPermissionEvaluator.canView()
evaluates totrue
. Or if it has a permission toAdminPermissionsSchema.VIEW_MEMBERS
orAdminPermissionsSchema.MANAGE_MEMBERS
of the group. -
requireManageMembership
Throws ForbiddenException ifcanManageMembership(GroupModel)
returnsfalse
. -
requireManageMembers
Throws ForbiddenException ifcanManageMembership(GroupModel)
returnsfalse
. -
getAccess
Returns Map with information what access the caller for the provided group has. -
getGroupIdsWithViewPermission
IfUserPermissionEvaluator.canView()
evaluates totrue
, returns empty set.- Returns:
- Stream of IDs of groups with view permission.
-