Package org.appng.api.support
Class DefaultPermissionProcessor
- java.lang.Object
-
- org.appng.api.support.DefaultPermissionProcessor
-
- All Implemented Interfaces:
PermissionProcessor
- Direct Known Subclasses:
DummyPermissionProcessor
public class DefaultPermissionProcessor extends Object implements PermissionProcessor
DefaultPermissionProcessor
implementation.- Author:
- Matthias Müller
-
-
Constructor Summary
Constructors Constructor Description DefaultPermissionProcessor(Subject subject, Site site, Application application)
Creates a new DefaultPermissionProcessor for the givenSubject
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasPermission(String permissionRef)
Checks whether thePermission
identified by the givenreference
is present.boolean
hasPermissions(PermissionOwner permissionOwner)
Checks whether all of thePermissionOwner
sPermission
s are present.boolean
hasReadPermission(FieldDef fieldDefinition)
Checks whether thePermission
s to read the value for the givenFieldDef
are present.boolean
hasWritePermission(FieldDef fieldDefinition)
Checks whether thePermission
s to write the value for the givenFieldDef
are present.
-
-
-
Constructor Detail
-
DefaultPermissionProcessor
public DefaultPermissionProcessor(Subject subject, Site site, Application application)
Creates a new DefaultPermissionProcessor for the givenSubject
. The currentSubject
uses the givenApplication
on the givenSite
.- Parameters:
subject
- the currentSubject
(if any)site
- theSite
currently used by theSubject
application
- theApplication
currently used by theSubject
-
-
Method Detail
-
hasPermissions
public boolean hasPermissions(PermissionOwner permissionOwner)
Description copied from interface:PermissionProcessor
Checks whether all of thePermissionOwner
sPermission
s are present.- Specified by:
hasPermissions
in interfacePermissionProcessor
- Parameters:
permissionOwner
- thePermissionOwner
- Returns:
true
if all permissions are present,false
otherwise
-
hasPermission
public boolean hasPermission(String permissionRef)
Description copied from interface:PermissionProcessor
Checks whether thePermission
identified by the givenreference
is present.- Specified by:
hasPermission
in interfacePermissionProcessor
- Parameters:
permissionRef
- the name of thePermission
to check- Returns:
true
if the permission is present,false
otherwise- See Also:
Permission.getRef()
-
hasWritePermission
public boolean hasWritePermission(FieldDef fieldDefinition)
Description copied from interface:PermissionProcessor
Checks whether thePermission
s to write the value for the givenFieldDef
are present.- Specified by:
hasWritePermission
in interfacePermissionProcessor
- Parameters:
fieldDefinition
- theFieldDef
to check the write-permission for- Returns:
true
if the permissions are present and theFieldDef
isn't readonly,false
otherwise- See Also:
FieldDef.getReadonly()
,FieldPermissions
,FieldPermissionType.WRITE
-
hasReadPermission
public boolean hasReadPermission(FieldDef fieldDefinition)
Description copied from interface:PermissionProcessor
Checks whether thePermission
s to read the value for the givenFieldDef
are present.- Specified by:
hasReadPermission
in interfacePermissionProcessor
- Parameters:
fieldDefinition
- theFieldDef
to check the read-permission for- Returns:
true
if the permissions are present,false
otherwise- See Also:
FieldPermissions
,FieldPermissionType.READ
-
-