public class DefaultPermissionProcessor extends Object implements PermissionProcessor
PermissionProcessor
implementation.Constructor and Description |
---|
DefaultPermissionProcessor(Subject subject,
Site site,
Application application)
Creates a new DefaultPermissionProcessor for the given
Subject . |
Modifier and Type | Method and Description |
---|---|
boolean |
hasPermission(String permissionRef)
Checks whether the
Permission identified by the given reference is present. |
boolean |
hasPermissions(PermissionOwner permissionOwner)
Checks whether all of the
PermissionOwner s Permission s are present. |
boolean |
hasReadPermission(FieldDef fieldDefinition)
Checks whether the
Permission s to read the value for the given FieldDef are present. |
boolean |
hasWritePermission(FieldDef fieldDefinition)
Checks whether the
Permission s to write the value for the given FieldDef are present. |
public DefaultPermissionProcessor(Subject subject, Site site, Application application)
Subject
. The current Subject
uses the
given Application
on the given Site
.subject
- the current Subject
(if any)site
- the Site
currently used by the Subject
application
- the Application
currently used by the Subject
public boolean hasPermissions(PermissionOwner permissionOwner)
PermissionProcessor
PermissionOwner
s Permission
s are present.hasPermissions
in interface PermissionProcessor
permissionOwner
- the PermissionOwner
true
if all permissions are present, false
otherwisepublic boolean hasPermission(String permissionRef)
PermissionProcessor
Permission
identified by the given reference
is present.hasPermission
in interface PermissionProcessor
permissionRef
- the name of the Permission
to checktrue
if the permission is present, false
otherwisePermission.getRef()
public boolean hasWritePermission(FieldDef fieldDefinition)
PermissionProcessor
Permission
s to write the value for the given FieldDef
are present.hasWritePermission
in interface PermissionProcessor
fieldDefinition
- the FieldDef
to check the write-permission fortrue
if the permissions are present and the FieldDef
isn't readonly, false
otherwiseFieldDef.getReadonly()
,
FieldPermissions
,
FieldPermissionType.WRITE
public boolean hasReadPermission(FieldDef fieldDefinition)
PermissionProcessor
Permission
s to read the value for the given FieldDef
are present.hasReadPermission
in interface PermissionProcessor
fieldDefinition
- the FieldDef
to check the read-permission fortrue
if the permissions are present, false
otherwiseFieldPermissions
,
FieldPermissionType.READ
Copyright © 2011–2020 aiticon GmbH. All rights reserved.