edu.internet2.middleware.grouper.privs
Class AccessPrivilege

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

public class AccessPrivilege
extends Object
implements GrouperPrivilege, Comparable

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 Set<Privilege> MANAGE_PRIVILEGES
          any of these constitutes MANAGE on a group note, keep most common/likely privs toward the front
static Privilege OPTIN
           
static Privilege OPTOUT
           
static Privilege READ
           
static 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 Privilege VIEW
           
static 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, Subject subj, Subject owner, Privilege priv, String klass, boolean isRevokable, String contextId1)
           
 
Method Summary
 int compareTo(Object o)
           
 boolean equals(Object other)
           
static Set<Privilege> filter(Collection<Privilege> privileges)
          filter some privs for access privs
static Set<String> getAllPrivilegeNames()
          Get all privilege names.
 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.
 String getImplementationName()
          Get name of implementation class for this privilege type.
 String getName()
          Get name of privilege.
 Subject getOwner()
          Get subject which was granted privilege on this object.
 Privilege getPrivilege()
          get the privilege, convert from name
 Subject getSubject()
          Get subject which has this privilege.
 String getType()
          get type of privilege (e.g.
 int hashCode()
           
 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

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

VIEW

public static final Privilege VIEW

VIEW_PRIVILEGES

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


READ_PRIVILEGES

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


MANAGE_PRIVILEGES

public static 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,
                       Subject subj,
                       Subject owner,
                       Privilege priv,
                       String klass,
                       boolean isRevokable,
                       String contextId1)
Parameters:
group -
subj -
owner -
priv -
klass -
isRevokable -
Method Detail

filter

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

Parameters:
privileges -
Returns:
a new set of privs

listToPriv

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

Parameters:
list -
Returns:
the privilege

privToList

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

Parameters:
privilege -
Returns:
the list name

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class 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 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 String getName()
Get name of privilege.

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

getOwner

public 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 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 String toString()
Overrides:
toString in class 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 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(Object o)
Specified by:
compareTo in interface Comparable
See Also:
Comparable.compareTo(java.lang.Object)

getContextId

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

Returns:
context id

getAllPrivilegeNames

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

Returns:
the set of privilege names