public class CollectionPermission extends Object implements org.apache.shiro.authz.Permission
Modifier and Type | Field and Description |
---|---|
protected String |
action |
static String |
CREATE_ACTION |
static String |
DELETE_ACTION |
protected static String |
PERMISSION_END_MSG |
protected static String |
PERMISSION_IMPLIES_MSG |
protected static String |
PERMISSION_NOT_IMPLIES_MSG |
protected static String |
PERMISSION_START_MSG |
protected List<org.apache.shiro.authz.Permission> |
permissionList |
static String |
READ_ACTION |
static String |
UNKNOWN_ACTION |
static String |
UPDATE_ACTION |
Constructor and Description |
---|
CollectionPermission()
Default constructor creating an empty collection of permissions.
|
CollectionPermission(String action) |
CollectionPermission(String action,
Collection<? extends org.apache.shiro.authz.Permission> permissions)
Creates a new collection of permissions from an existing collection of permissions.
|
CollectionPermission(String action,
org.apache.shiro.authz.Permission... permissions)
Creates a new collection of permissions and adds the provided permissions to the collection.
|
Modifier and Type | Method and Description |
---|---|
void |
addAll(Collection<? extends org.apache.shiro.authz.Permission> permissions)
Adds all of the incoming permissions to this collection.
|
void |
clear()
Clears out all of the permissions currently in this collection.
|
String |
getAction()
Returns the action associated with this collection of permissions
|
List<org.apache.shiro.authz.Permission> |
getPermissionList()
Returns this collection as an unmodifiable list of permissions.
|
boolean |
implies(org.apache.shiro.authz.Permission p)
Returns
true if this current instance implies all the functionality and/or
resource access described by the specified Permission argument, false
otherwise. |
boolean |
isEmpty()
Returns true if the internal permissions list is empty otherwise returns false
|
void |
setAction(String action)
Sets the action for this collection of permissions
|
String |
toString()
String representation of this collection of permissions.
|
public static final String CREATE_ACTION
public static final String READ_ACTION
public static final String UPDATE_ACTION
public static final String DELETE_ACTION
public static final String UNKNOWN_ACTION
protected static final String PERMISSION_START_MSG
protected static final String PERMISSION_IMPLIES_MSG
protected static final String PERMISSION_NOT_IMPLIES_MSG
protected static final String PERMISSION_END_MSG
protected List<org.apache.shiro.authz.Permission> permissionList
protected String action
public CollectionPermission()
public CollectionPermission(String action)
action
- Action associated with this collection of permissionspublic CollectionPermission(String action, org.apache.shiro.authz.Permission... permissions)
action
- Action associated with this collection of permissionspermissions
- permission objects to be added to the newly created collectionpublic CollectionPermission(String action, Collection<? extends org.apache.shiro.authz.Permission> permissions)
action
- Action associated with this collection of permissionspermissions
- existing collection of permission objectspublic boolean implies(org.apache.shiro.authz.Permission p)
true
if this current instance implies all the functionality and/or
resource access described by the specified Permission
argument, false
otherwise.
That is, this current instance must be exactly equal to or a superset of the
functionalty and/or resource access described by the given Permission
argument. Yet
another way of saying this would be:
If "permission1 implies permission2", i.e. permission1.implies(permission2)
, then any Subject granted permission1
would have ability greater than or equal
to that defined by permission2
.
implies
in interface org.apache.shiro.authz.Permission
p
- the permission to check for behavior/functionality comparison.true
if this current instance implies all the functionality and/or
resource access described by the specified Permission
argument, false
otherwise.public List<org.apache.shiro.authz.Permission> getPermissionList()
public boolean isEmpty()
public String toString()
public void clear()
public void addAll(Collection<? extends org.apache.shiro.authz.Permission> permissions)
permissions
- The permissions that should be added.public String getAction()
public void setAction(String action)
action
- This work is licensed under a Creative Commons Attribution 4.0 International License.