@Portable public class DotNamedPermission extends Object implements Permission, Comparable<Permission>
implies(Permission other) implementation is based on the simple fact that one permission implies
another just if its name starts with the another's name. This very simple mechanism can be applied to most of
the resources that require authorization control, like for instance, workbench perspectives, a file system, etc.| Constructor and Description |
|---|
DotNamedPermission() |
DotNamedPermission(String name) |
DotNamedPermission(String name,
AuthorizationResult result) |
DotNamedPermission(String name,
Boolean granted) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
_checkImmutability() |
protected void |
_enableImmutability() |
Permission |
clone()
Creates an exact copy of this instance.
|
int |
compareTo(Permission o) |
boolean |
equals(Object obj) |
boolean |
equalsName(Permission other) |
boolean |
equalsResult(Permission other) |
String |
getName()
A string literal that identifies a resource or set of resources this permission object relates to.
|
AuthorizationResult |
getResult()
The authorization result or permission status.
|
boolean |
implies(Permission other)
Basically, "permission p1 implies permission p2" means that
if one is granted permission p1, one is naturally granted permission p2.
|
boolean |
impliesName(Permission other)
If "permission p1 impliesName permission p2" means that the feature represented by p1 is a superset of p2.
|
boolean |
impliesResult(Permission other)
If "permission p1 impliesResult permission p2" means that both permissions give the same result.
|
<T extends DotNamedPermission> |
nonMutable() |
void |
setName(String name) |
void |
setResult(AuthorizationResult result)
Change the authorzation result.
|
String |
toString() |
public DotNamedPermission()
public DotNamedPermission(String name)
public DotNamedPermission(String name, AuthorizationResult result)
protected void _enableImmutability()
protected void _checkImmutability()
public <T extends DotNamedPermission> T nonMutable()
public String getName()
PermissionIt's up to every Permission implementation to define what's the set the name's format.
getName in interface Permissionpublic void setName(String name)
public AuthorizationResult getResult()
PermissiongetResult in interface Permissionpublic void setResult(AuthorizationResult result)
PermissionsetResult in interface Permissionresult - GRANT / DENY / ABSTAINpublic boolean implies(Permission other)
Permission
Both calls to Permission.impliesName(Permission) & Permission.impliesResult(Permission) return true.
implies in interface Permissionother - the permission to check against.public boolean impliesName(Permission other)
PermissionimpliesName in interface Permissionother - the permission to check against.public boolean impliesResult(Permission other)
PermissionimpliesResult in interface Permissionother - the permission to check against.public boolean equalsName(Permission other)
public boolean equalsResult(Permission other)
public int compareTo(Permission o)
compareTo in interface Comparable<Permission>public Permission clone()
Permissionclone in interface Permissionclone in class ObjectCopyright © 2012–2017 JBoss by Red Hat. All rights reserved.