edu.internet2.middleware.grouper.privs
Class AttributeDefPrivilege

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

public class AttributeDefPrivilege
extends java.lang.Object
implements GrouperPrivilege, java.lang.Comparable

An instance of a granted access privilege to attribute.

Version:
$Id: AttributeDefPrivilege.java,v 1.1 2009-09-21 06:14:26 mchyzer Exp $
Author:
blair christensen.

Field Summary
static Privilege ATTR_ADMIN
           
static Privilege ATTR_OPTIN
           
static Privilege ATTR_OPTOUT
           
static Privilege ATTR_READ
           
static Privilege ATTR_UPDATE
           
static Privilege ATTR_VIEW
           
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> READ_PRIVILEGES
          any of these constitutes READ on a group note, keep most common/likely privs toward the front
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
AttributeDefPrivilege(AttributeDef attributeDef1, edu.internet2.middleware.subject.Subject subj1, edu.internet2.middleware.subject.Subject owner1, Privilege priv, java.lang.String klass1, boolean isRevokable1, java.lang.String contextId1)
           
 
Method Summary
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object other)
           
static java.util.Set<Privilege> filter(java.util.Collection<Privilege> privileges)
          filter some privs for access privs
 AttributeDef getAttributeDef()
          Get AttributeDef that the privilege was granted on.
 java.lang.String getContextId()
          optionally link the audit id with the low level action
 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()
           
 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

ATTR_ADMIN

public static final Privilege ATTR_ADMIN

ATTR_OPTIN

public static final Privilege ATTR_OPTIN

ATTR_OPTOUT

public static final Privilege ATTR_OPTOUT

ATTR_READ

public static final Privilege ATTR_READ

ATTR_UPDATE

public static final Privilege ATTR_UPDATE

ATTR_VIEW

public static final Privilege ATTR_VIEW

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


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


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

AttributeDefPrivilege

public AttributeDefPrivilege(AttributeDef attributeDef1,
                             edu.internet2.middleware.subject.Subject subj1,
                             edu.internet2.middleware.subject.Subject owner1,
                             Privilege priv,
                             java.lang.String klass1,
                             boolean isRevokable1,
                             java.lang.String contextId1)
Parameters:
attributeDef1 -
subj1 -
owner1 -
priv -
klass1 -
isRevokable1 -
contextId1 -
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

getAttributeDef

public AttributeDef getAttributeDef()
Get AttributeDef that the privilege was granted on.

Returns:
AttributeDef

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 o)
Specified by:
compareTo in interface java.lang.Comparable
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