org.sakaiproject.component.legacy.authzGroup
Class BaseRole

java.lang.Object
  extended byorg.sakaiproject.component.legacy.authzGroup.BaseRole
All Implemented Interfaces:
Comparable, Role, Serializable

public class BaseRole
extends Object
implements Role

BaseRole is an implementation of the AuthzGroup API Role.

Author:
Sakai Software Development Team
See Also:
Serialized Form

Field Summary
protected  boolean m_active
          Active flag.
protected  String m_description
          The role description.
protected  String m_id
          The role id.
protected  Set m_locks
          The locks that make up this.
 
Constructor Summary
BaseRole(Element el, AuthzGroup azGroup)
          Construct from information in XML.
BaseRole(String id)
          Construct.
BaseRole(String id, Role other)
          Construct as a copy
 
Method Summary
protected  void activate()
          Enable editing.
 void allowFunction(String lock)
          Add this function to the set of functions that users with this role are allowed to perform.
 void allowFunctions(Collection locks)
          Add these functions to the set of functions that users with this role are allowed to perform.
 boolean allowsNoFunctions()
          Check if the Role has no functons in the set of functions that users with this role are allowed to perform.
protected  void closeEdit()
          Close the azGroup object - it cannot be used after this.
 int compareTo(Object obj)
          
 void disallowAll()
          Remove all functions from the set of functions that users with this role are allowed to perform.
 void disallowFunction(String lock)
          Remove this function from the set of functions that users with this role are allowed to perform.
 void disallowFunctions(Collection locks)
          Remove these functions from the set of functions that users with this role are allowed to perform.
 boolean equals(Object obj)
          
 Set getAllowedFunctions()
          Access the set of functions that users with this role are allowed to perform.
 String getDescription()
          Access the Role description.
 String getId()
          Access the Role id.
 int hashCode()
          
 boolean isActiveEdit()
          Check to see if the azGroup is still active, or has already been closed.
 boolean isAllowed(String lock)
          Test if users with this role are allowed to perform this named function.
 void setDescription(String description)
          Set the role description.
 Element toXml(Document doc, Stack stack)
          {@inheritDoc}
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_id

protected String m_id
The role id.


m_locks

protected Set m_locks
The locks that make up this.


m_description

protected String m_description
The role description.


m_active

protected boolean m_active
Active flag.

Constructor Detail

BaseRole

public BaseRole(String id)
Construct.

Parameters:
id - The role id.

BaseRole

public BaseRole(String id,
                Role other)
Construct as a copy

Parameters:
id - The role id.
other - The role to copy.

BaseRole

public BaseRole(Element el,
                AuthzGroup azGroup)
Construct from information in XML.

Parameters:
el - The XML DOM Element definining the role.
Method Detail

toXml

public Element toXml(Document doc,
                     Stack stack)
{@inheritDoc}


activate

protected void activate()
Enable editing.


isActiveEdit

public boolean isActiveEdit()
Check to see if the azGroup is still active, or has already been closed.

Returns:
true if the azGroup is active, false if it's been closed.

closeEdit

protected void closeEdit()
Close the azGroup object - it cannot be used after this.


getId

public String getId()
Access the Role id.

Specified by:
getId in interface Role
Returns:
The role id.

getDescription

public String getDescription()
Access the Role description.

Specified by:
getDescription in interface Role
Returns:
The role description.

isAllowed

public boolean isAllowed(String lock)
Test if users with this role are allowed to perform this named function.

Specified by:
isAllowed in interface Role
Parameters:
lock - The function name.
Returns:
true if users with this role are allowed to perform this named function, false if not.

getAllowedFunctions

public Set getAllowedFunctions()
Access the set of functions that users with this role are allowed to perform.

Specified by:
getAllowedFunctions in interface Role
Returns:
The Set of function names (String) that users with this role are allowed to perform.

setDescription

public void setDescription(String description)
Set the role description.

Specified by:
setDescription in interface Role
Parameters:
description - The role description.

allowFunction

public void allowFunction(String lock)
Add this function to the set of functions that users with this role are allowed to perform.

Specified by:
allowFunction in interface Role

allowFunctions

public void allowFunctions(Collection locks)
Add these functions to the set of functions that users with this role are allowed to perform.

Specified by:
allowFunctions in interface Role
Parameters:
locks - The Collection (String) of function names to add to the allowed set.

disallowFunction

public void disallowFunction(String lock)
Remove this function from the set of functions that users with this role are allowed to perform.

Specified by:
disallowFunction in interface Role

disallowFunctions

public void disallowFunctions(Collection locks)
Remove these functions from the set of functions that users with this role are allowed to perform.

Specified by:
disallowFunctions in interface Role

allowsNoFunctions

public boolean allowsNoFunctions()
Check if the Role has no functons in the set of functions that users with this role are allowed to perform.

Specified by:
allowsNoFunctions in interface Role
Returns:
true if the role has no allowed functions, false if it does.

disallowAll

public void disallowAll()
Remove all functions from the set of functions that users with this role are allowed to perform.

Specified by:
disallowAll in interface Role

compareTo

public int compareTo(Object obj)

Specified by:
compareTo in interface Comparable

equals

public boolean equals(Object obj)


hashCode

public int hashCode()