edu.internet2.middleware.grouper.privs
Class AccessPrivilege

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

public class AccessPrivilege
extends java.lang.Object
implements GrouperPrivilege, java.lang.Comparable<java.lang.Object>

An instance of a granted access privilege.

Version:
$Id: AccessPrivilege.java,v 1.12 2009-09-25 16:13:45 tzeller Exp $
Author:
blair christensen.

Field Summary
static Privilege ADMIN
           
static java.util.Set<Privilege> ADMIN_IMPLIED_PRIVILEGES
          these privileges are implied by ADMIN
static java.util.Set<Privilege> ADMIN_PRIVILEGES
          any of these constitutes ADMIN on a group note, keep most common/likely privs toward the front
static java.util.Set<Privilege> ALL_PRIVILEGES
          these are all the group access privileges note, keep most common/likely privs toward the front
static java.util.Set<Privilege> ATTRIBUTE_READ_PRIVILEGES
          any of these constitutes GROUP_ATTR_READ on a group note, keep most common/likely privs toward the front
static java.util.Set<Privilege> ATTRIBUTE_UPDATE_PRIVILEGES
          any of these constitutes GROUP_ATTR_UPDATE on a group note, keep most common/likely privs toward the front
static Privilege GROUP_ATTR_READ
           
static java.util.Set<Privilege> GROUP_ATTR_READ_IMPLIED_PRIVILEGES
          these privileges are implied by GROUP_ATTR_READ
static java.util.Set<Privilege> GROUP_ATTR_READ_PRIVILEGES
          any of these constitutes GROUP_ATTR_READ on a group note, keep most common/likely privs toward the front
static Privilege GROUP_ATTR_UPDATE
           
static java.util.Set<Privilege> GROUP_ATTR_UPDATE_IMPLIED_PRIVILEGES
          these privileges are implied by GROUP_ATTR_UPDATE
static java.util.Set<Privilege> GROUP_ATTR_UPDATE_PRIVILEGES
          any of these constitutes GROUP_ATTR_UPDATE on a group note, keep most common/likely privs toward the front
static java.util.Set<Privilege> MANAGE_PRIVILEGES
          any of these constitutes MANAGE on a group note, keep most common/likely privs toward the front
static java.util.Set<Privilege> OPT_OR_READ_PRIVILEGES
          if any of the opt privs, or update, or read, or admin.
static Privilege OPTIN
           
static java.util.Set<Privilege> OPTIN_IMPLIED_PRIVILEGES
          these privileges are implied by OPTIN
static java.util.Set<Privilege> OPTIN_PRIVILEGES
          any of these constitutes OPTIN on a group note, keep most common/likely privs toward the front
static Privilege OPTOUT
           
static java.util.Set<Privilege> OPTOUT_IMPLIED_PRIVILEGES
          these privileges are implied by OPTOUT
static java.util.Set<Privilege> OPTOUT_PRIVILEGES
          any of these constitutes OPTOUT on a group note, keep most common/likely privs toward the front
static Privilege READ
           
static java.util.Set<Privilege> READ_IMPLIED_PRIVILEGES
          these privileges are implied by READ
static java.util.Set<Privilege> READ_PRIVILEGES
          any of these constitutes READ on a group note, keep most common/likely privs toward the front
static Privilege SYSTEM
           
static Privilege UPDATE
           
static java.util.Set<Privilege> UPDATE_IMPLIED_PRIVILEGES
          these privileges are implied by UPDATE
static java.util.Set<Privilege> UPDATE_PRIVILEGES
          any of these constitutes UPDATE on a group note, keep most common/likely privs toward the front
static Privilege VIEW
           
static java.util.Set<Privilege> VIEW_ENTITY_PRIVILEGES
          any of these constitutes VIEW on an entity note, keep most common/likely privs toward the front
static java.util.Set<Privilege> VIEW_IMPLIED_PRIVILEGES
          these privileges are implied by VIEW
static java.util.Set<Privilege> VIEW_PRIVILEGES
          any of these constitutes VIEW on a group note, keep most common/likely privs toward the front
 
Constructor Summary
AccessPrivilege(Group group, edu.internet2.middleware.subject.Subject subj, edu.internet2.middleware.subject.Subject owner, Privilege priv, java.lang.String klass, boolean isRevokable, java.lang.String contextId1)
           
 
Method Summary
 int compareTo(java.lang.Object that)
           
 boolean equals(java.lang.Object other)
           
static java.util.Set<Privilege> filter(java.util.Collection<Privilege> privileges)
          filter some privs for access privs
static java.util.Set<java.lang.String> getAllPrivilegeNames()
          Get all privilege names.
 java.lang.String getContextId()
          optionally link the audit id with the low level action
 Group getGroup()
          Get Group that the privilege was granted on.
 GrouperAPI getGrouperApi()
          get the object this privilege is assigned to (e.g. group or stem object)
 java.lang.String getImplementationName()
          Get name of implementation class for this privilege type.
 java.lang.String getName()
          Get name of privilege.
 edu.internet2.middleware.subject.Subject getOwner()
          Get subject which was granted privilege on this object.
 Privilege getPrivilege()
          get the privilege, convert from name
 edu.internet2.middleware.subject.Subject getSubject()
          Get subject which has this privilege.
 java.lang.String getType()
          get type of privilege (e.g. access or naming)
 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(java.lang.String list)
          convert a list to a privilege
static java.lang.String privToList(Privilege privilege)
          convert a privilege to a list
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ADMIN

public static final Privilege ADMIN

OPTIN

public static final Privilege OPTIN

OPTOUT

public static final Privilege OPTOUT

READ

public static final Privilege READ

SYSTEM

public static final Privilege SYSTEM

UPDATE

public static final Privilege UPDATE

OPTOUT_PRIVILEGES

public static java.util.Set<Privilege> OPTOUT_PRIVILEGES
any of these constitutes OPTOUT on a group note, keep most common/likely privs toward the front


OPTIN_PRIVILEGES

public static java.util.Set<Privilege> OPTIN_PRIVILEGES
any of these constitutes OPTIN on a group note, keep most common/likely privs toward the front


OPT_OR_READ_PRIVILEGES

public static java.util.Set<Privilege> OPT_OR_READ_PRIVILEGES
if any of the opt privs, or update, or read, or admin. to see if someone can opt themselves out of their membership


VIEW

public static final Privilege VIEW

GROUP_ATTR_READ

public static final Privilege GROUP_ATTR_READ

GROUP_ATTR_READ_PRIVILEGES

public static java.util.Set<Privilege> GROUP_ATTR_READ_PRIVILEGES
any of these constitutes GROUP_ATTR_READ on a group note, keep most common/likely privs toward the front


GROUP_ATTR_UPDATE

public static final Privilege GROUP_ATTR_UPDATE

GROUP_ATTR_UPDATE_PRIVILEGES

public static java.util.Set<Privilege> GROUP_ATTR_UPDATE_PRIVILEGES
any of these constitutes GROUP_ATTR_UPDATE on a group note, keep most common/likely privs toward the front


VIEW_PRIVILEGES

public static java.util.Set<Privilege> VIEW_PRIVILEGES
any of these constitutes VIEW on a group note, keep most common/likely privs toward the front


ALL_PRIVILEGES

public static java.util.Set<Privilege> ALL_PRIVILEGES
these are all the group access privileges note, keep most common/likely privs toward the front


ATTRIBUTE_READ_PRIVILEGES

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


ATTRIBUTE_UPDATE_PRIVILEGES

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


UPDATE_PRIVILEGES

public static java.util.Set<Privilege> UPDATE_PRIVILEGES
any of these constitutes UPDATE on a group note, keep most common/likely privs toward the front


VIEW_ENTITY_PRIVILEGES

public static java.util.Set<Privilege> VIEW_ENTITY_PRIVILEGES
any of these constitutes VIEW on an entity note, keep most common/likely privs toward the front


READ_PRIVILEGES

public static java.util.Set<Privilege> READ_PRIVILEGES
any of these constitutes READ on a group note, keep most common/likely privs toward the front


ADMIN_PRIVILEGES

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


ADMIN_IMPLIED_PRIVILEGES

public static java.util.Set<Privilege> ADMIN_IMPLIED_PRIVILEGES
these privileges are implied by ADMIN


UPDATE_IMPLIED_PRIVILEGES

public static java.util.Set<Privilege> UPDATE_IMPLIED_PRIVILEGES
these privileges are implied by UPDATE


READ_IMPLIED_PRIVILEGES

public static java.util.Set<Privilege> READ_IMPLIED_PRIVILEGES
these privileges are implied by READ


OPTIN_IMPLIED_PRIVILEGES

public static java.util.Set<Privilege> OPTIN_IMPLIED_PRIVILEGES
these privileges are implied by OPTIN


OPTOUT_IMPLIED_PRIVILEGES

public static java.util.Set<Privilege> OPTOUT_IMPLIED_PRIVILEGES
these privileges are implied by OPTOUT


VIEW_IMPLIED_PRIVILEGES

public static java.util.Set<Privilege> VIEW_IMPLIED_PRIVILEGES
these privileges are implied by VIEW


GROUP_ATTR_UPDATE_IMPLIED_PRIVILEGES

public static java.util.Set<Privilege> GROUP_ATTR_UPDATE_IMPLIED_PRIVILEGES
these privileges are implied by GROUP_ATTR_UPDATE


GROUP_ATTR_READ_IMPLIED_PRIVILEGES

public static java.util.Set<Privilege> GROUP_ATTR_READ_IMPLIED_PRIVILEGES
these privileges are implied by GROUP_ATTR_READ


MANAGE_PRIVILEGES

public static java.util.Set<Privilege> MANAGE_PRIVILEGES
any of these constitutes MANAGE on a group note, keep most common/likely privs toward the front

Constructor Detail

AccessPrivilege

public AccessPrivilege(Group group,
                       edu.internet2.middleware.subject.Subject subj,
                       edu.internet2.middleware.subject.Subject owner,
                       Privilege priv,
                       java.lang.String klass,
                       boolean isRevokable,
                       java.lang.String contextId1)
Parameters:
group -
subj -
owner -
priv -
klass -
isRevokable -
Method Detail

filter

public static java.util.Set<Privilege> filter(java.util.Collection<Privilege> privileges)
filter some privs for access privs

Parameters:
privileges -
Returns:
a new set of privs

listToPriv

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

Parameters:
list -
Returns:
the privilege

privToList

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

Parameters:
privilege -
Returns:
the list name

equals

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

hashCode

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

getPrivilege

public Privilege getPrivilege()
get the privilege, convert from name

Returns:
named Privilege

getGroup

public Group getGroup()
Get Group that the privilege was granted on.

Returns:
Group

getImplementationName

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

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

getName

public java.lang.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.

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.

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.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

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 java.lang.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()

compareTo

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

getContextId

public java.lang.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)

getAllPrivilegeNames

public static java.util.Set<java.lang.String> getAllPrivilegeNames()
Get all privilege names.

Returns:
the set of privilege names