org.apache.shiro.authz
Class SimpleRole

java.lang.Object
  extended by 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
protected  String name
           
protected  Set<Permission> permissions
           
 
Constructor Summary
SimpleRole()
           
SimpleRole(String name)
           
SimpleRole(String name, Set<Permission> permissions)
           
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2014 The Apache Software Foundation. All Rights Reserved.