edu.internet2.middleware.grouper.privs
Class NamingPrivilege

java.lang.Object
  extended by edu.internet2.middleware.grouper.privs.NamingPrivilege
All Implemented Interfaces:
GrouperPrivilege, Comparable<Object>

public class NamingPrivilege
extends Object
implements GrouperPrivilege, Comparable<Object>

An instance of a granted naming privilege.

Version:
$Id: NamingPrivilege.java,v 1.8 2009-04-13 20:24:29 mchyzer Exp $
Author:
blair christensen.

Field Summary
static Set<Privilege> ADMIN_PRIVILEGES
          any of these constitutes ADMIN on a stem note, keep most common/likely privs toward the front
static Set<Privilege> ALL_ADMIN_PRIVILEGES
          any of these constitutes some sort of ADMIN on a stem note, keep most common/likely privs toward the front
static Set<Privilege> ALL_PRIVILEGES
          ALL note, keep most common/likely privs toward the front
static Set<Privilege> ATTRIBUTE_READ_PRIVILEGES
          any of these constitutes STEM_ATTR_READ on a group note, keep most common/likely privs toward the front
static Set<Privilege> ATTRIBUTE_UPDATE_PRIVILEGES
          any of these constitutes STEM_ATTR_UPDATE on a group note, keep most common/likely privs toward the front
static Privilege CREATE
          can create objects in this stem
static Set<Privilege> CREATE_IMPLIED_PRIVILEGES
          these privileges are implied by CREATE
static Set<Privilege> CREATE_PRIVILEGES
          any of these constitutes CREATE on a stem note, keep most common/likely privs toward the front
static Privilege STEM
          can create stems in this stem
static Privilege STEM_ADMIN
          can admin stem
static Set<Privilege> STEM_ADMIN_IMPLIED_PRIVILEGES
          these privileges are implied by STEM_ADMIN
static Privilege STEM_ATTR_READ
          can read attributes on this stem
static Set<Privilege> STEM_ATTR_READ_IMPLIED_PRIVILEGES
          these privileges are implied by STEM_ATTR_READ
static Set<Privilege> STEM_ATTR_READ_PRIVILEGES
          any of these constitutes STEM_ATTR_READ on a stem note, keep most common/likely privs toward the front
static Privilege STEM_ATTR_UPDATE
          can update attributes on this stem
static Set<Privilege> STEM_ATTR_UPDATE_IMPLIED_PRIVILEGES
          these privileges are implied by STEM_ATTR_UPDATE
static Set<Privilege> STEM_ATTR_UPDATE_PRIVILEGES
          any of these constitutes STEM_ATTR_UPDATE on a stem note, keep most common/likely privs toward the front
static Set<Privilege> STEM_IMPLIED_PRIVILEGES
          these privileges are implied by STEM
static Set<Privilege> STEM_PRIVILEGES
          any of these constitutes STEM on a stem note, keep most common/likely privs toward the front
 
Constructor Summary
NamingPrivilege(Stem stem, edu.internet2.middleware.subject.Subject subj, edu.internet2.middleware.subject.Subject owner, Privilege priv, String klass, boolean isRevokable, String contextId1)
           
 
Method Summary
 int compareTo(Object o)
           
 boolean equals(Object other)
           
 String getContextId()
          optionally link the audit id with the low level action
 GrouperAPI getGrouperApi()
          get the object this privilege is assigned to (e.g.
 String getImplementationName()
          Get name of implementation class for this privilege type.
 String getName()
          Get name of privilege.
 edu.internet2.middleware.subject.Subject getOwner()
          Get subject which was granted privilege on this object.
 Stem getStem()
          Get object Stem that the privilege was granted on.
 edu.internet2.middleware.subject.Subject getSubject()
          Get subject which has this privilege.
 String getType()
          get type of privilege (e.g.
 int hashCode()
           
 void internalSetSubject(edu.internet2.middleware.subject.Subject subject)
          if we are caching subject objects, then set it here...
 boolean isRevokable()
          Returns true if privilege can be revoked.
static Privilege listToPriv(String list)
          convert a list to a privilege
static String privToList(Privilege privilege)
          convert a privilege to a list
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CREATE

public static final Privilege CREATE
can create objects in this stem


STEM

public static final Privilege STEM
can create stems in this stem


STEM_ADMIN

public static final Privilege STEM_ADMIN
can admin stem


STEM_PRIVILEGES

public static Set<Privilege> STEM_PRIVILEGES
any of these constitutes STEM on a stem note, keep most common/likely privs toward the front


STEM_ATTR_READ

public static final Privilege STEM_ATTR_READ
can read attributes on this stem


STEM_ATTR_READ_PRIVILEGES

public static Set<Privilege> STEM_ATTR_READ_PRIVILEGES
any of these constitutes STEM_ATTR_READ on a stem note, keep most common/likely privs toward the front


STEM_ATTR_UPDATE

public static final Privilege STEM_ATTR_UPDATE
can update attributes on this stem


STEM_IMPLIED_PRIVILEGES

public static Set<Privilege> STEM_IMPLIED_PRIVILEGES
these privileges are implied by STEM


STEM_ADMIN_IMPLIED_PRIVILEGES

public static Set<Privilege> STEM_ADMIN_IMPLIED_PRIVILEGES
these privileges are implied by STEM_ADMIN


CREATE_IMPLIED_PRIVILEGES

public static Set<Privilege> CREATE_IMPLIED_PRIVILEGES
these privileges are implied by CREATE


STEM_ATTR_READ_IMPLIED_PRIVILEGES

public static Set<Privilege> STEM_ATTR_READ_IMPLIED_PRIVILEGES
these privileges are implied by STEM_ATTR_READ


STEM_ATTR_UPDATE_IMPLIED_PRIVILEGES

public static Set<Privilege> STEM_ATTR_UPDATE_IMPLIED_PRIVILEGES
these privileges are implied by STEM_ATTR_UPDATE


STEM_ATTR_UPDATE_PRIVILEGES

public static Set<Privilege> STEM_ATTR_UPDATE_PRIVILEGES
any of these constitutes STEM_ATTR_UPDATE on a stem note, keep most common/likely privs toward the front


CREATE_PRIVILEGES

public static Set<Privilege> CREATE_PRIVILEGES
any of these constitutes CREATE on a stem note, keep most common/likely privs toward the front


ALL_PRIVILEGES

public static Set<Privilege> ALL_PRIVILEGES
ALL note, keep most common/likely privs toward the front


ATTRIBUTE_READ_PRIVILEGES

public static Set<Privilege> ATTRIBUTE_READ_PRIVILEGES
any of these constitutes STEM_ATTR_READ on a group note, keep most common/likely privs toward the front


ATTRIBUTE_UPDATE_PRIVILEGES

public static Set<Privilege> ATTRIBUTE_UPDATE_PRIVILEGES
any of these constitutes STEM_ATTR_UPDATE on a group note, keep most common/likely privs toward the front


ADMIN_PRIVILEGES

public static Set<Privilege> ADMIN_PRIVILEGES
any of these constitutes ADMIN on a stem note, keep most common/likely privs toward the front


ALL_ADMIN_PRIVILEGES

public static Set<Privilege> ALL_ADMIN_PRIVILEGES
any of these constitutes some sort of ADMIN on a stem note, keep most common/likely privs toward the front

Constructor Detail

NamingPrivilege

public NamingPrivilege(Stem stem,
                       edu.internet2.middleware.subject.Subject subj,
                       edu.internet2.middleware.subject.Subject owner,
                       Privilege priv,
                       String klass,
                       boolean isRevokable,
                       String contextId1)
Method Detail

privToList

public static String privToList(Privilege privilege)
convert a privilege to a list

Parameters:
privilege -
Returns:
the list name

listToPriv

public static Privilege listToPriv(String list)
convert a list to a privilege

Parameters:
list -
Returns:
the privilege

equals

public boolean equals(Object other)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable<Object>
See Also:
Comparable.compareTo(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Returns:
hashcode
Since:
1.2.0

getImplementationName

public String getImplementationName()
Get name of implementation class for this privilege type.

Specified by:
getImplementationName in interface GrouperPrivilege
Returns:
Class name of implementing class.

isRevokable

public boolean isRevokable()
Returns true if privilege can be revoked.

Specified by:
isRevokable in interface GrouperPrivilege
Returns:
Boolean true if privilege can be revoked.

getName

public String getName()
Get name of privilege.

Specified by:
getName in interface GrouperPrivilege
Returns:
Name of privilege.

getOwner

public edu.internet2.middleware.subject.Subject getOwner()
Get subject which was granted privilege on this object.

Specified by:
getOwner in interface GrouperPrivilege
Returns:
Subject that was granted privilege.

getStem

public Stem getStem()
Get object Stem that the privilege was granted on.

Returns:
Stem object.

getSubject

public edu.internet2.middleware.subject.Subject getSubject()
Get subject which has this privilege.

Specified by:
getSubject in interface GrouperPrivilege
Returns:
Subject that has this privilege.

toString

public String toString()
Overrides:
toString in class Object

getGrouperApi

public GrouperAPI getGrouperApi()
Description copied from interface: GrouperPrivilege
get the object this privilege is assigned to (e.g. group or stem object)

Specified by:
getGrouperApi in interface GrouperPrivilege
Returns:
the group or stem
See Also:
GrouperPrivilege.getGrouperApi()

getType

public String getType()
Description copied from interface: GrouperPrivilege
get type of privilege (e.g. access or naming)

Specified by:
getType in interface GrouperPrivilege
Returns:
the type
See Also:
GrouperPrivilege.getType()

getContextId

public String getContextId()
optionally link the audit id with the low level action

Returns:
context id

internalSetSubject

public void internalSetSubject(edu.internet2.middleware.subject.Subject subject)
Description copied from interface: GrouperPrivilege
if we are caching subject objects, then set it here... do not change the subject here

Specified by:
internalSetSubject in interface GrouperPrivilege
See Also:
GrouperPrivilege.internalSetSubject(Subject)