Package org.apache.shiro.authz
Class SimpleRole
- java.lang.Object
-
- org.apache.shiro.authz.SimpleRole
-
- All Implemented Interfaces:
Serializable
public class SimpleRole extends Object implements Serializable
A simple representation of a security role that has a name and a collection of permissions. This object can be used internally by Realms to maintain authorization state.- Since:
- 0.2
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
name
protected Set<Permission>
permissions
-
Constructor Summary
Constructors Constructor Description SimpleRole()
SimpleRole(String name)
SimpleRole(String name, Set<Permission> permissions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Permission permission)
void
addAll(Collection<Permission> perms)
boolean
equals(Object o)
String
getName()
Set<Permission>
getPermissions()
int
hashCode()
boolean
isPermitted(Permission p)
void
setName(String name)
void
setPermissions(Set<Permission> permissions)
String
toString()
-
-
-
Field Detail
-
name
protected String name
-
permissions
protected Set<Permission> permissions
-
-
Constructor Detail
-
SimpleRole
public SimpleRole()
-
SimpleRole
public SimpleRole(String name)
-
SimpleRole
public SimpleRole(String name, Set<Permission> permissions)
-
-
Method Detail
-
getName
public String getName()
-
setName
public void setName(String name)
-
getPermissions
public Set<Permission> getPermissions()
-
setPermissions
public void setPermissions(Set<Permission> permissions)
-
add
public void add(Permission permission)
-
addAll
public void addAll(Collection<Permission> perms)
-
isPermitted
public boolean isPermitted(Permission p)
-
-