edu.internet2.middleware.grouper.ui
Class DefaultUIGroupPrivilegeResolver

java.lang.Object
  extended by edu.internet2.middleware.grouper.ui.DefaultUIGroupPrivilegeResolver
All Implemented Interfaces:
UIGroupPrivilegeResolver

public class DefaultUIGroupPrivilegeResolver
extends Object
implements UIGroupPrivilegeResolver

The default implementation of UIGroupPrivilegeResolver - which simply applies the expected privilege resolution. Extend this class to add your own business logic, and configure in media.properties using the key: edu.internet2.middleware.grouper.ui.UIGroupPrivilegeResolver see https://bugs.internet2.edu/jira/browse/GRP-72

Version:
$Id: DefaultUIGroupPrivilegeResolver.java,v 1.4 2009-03-15 06:37:51 mchyzer Exp $
Author:
Gary Brown.

Constructor Summary
DefaultUIGroupPrivilegeResolver()
           
 
Method Summary
 Map asMap()
          Convenience method to provide all possible 'answers' in a Map - which is strightforward for JSP/JSTL to 'query'.
 boolean canEditGroup()
          Is the subject allowed to edit core attributes or delete the group?
 boolean canManageAnyCustomField()
          Can the subject change at least one custom attribute?
 boolean canManageField(String field)
          Can the subject modify the given field?
 boolean canManageMembers()
          Can the subject update the membership?
 boolean canManagePrivileges()
          Is the subject allowed to grant / revoke privileges?
 boolean canOptinGroup()
          Is the subject allowed to optin to the group?
 boolean canOptoutGroup()
          Is the subject allowed to optout of the group?
 boolean canReadField(String field)
          Can the subject read the given field?
 boolean canReadGroup()
          Is the subject allowed to view the membership?
 boolean canViewGroup()
          Is the subject allowed to view the group?
 void init()
          Called by the factory after group, subject and GrouperSession are set to allow any initialisation
 void setGroup(Group g)
          Can only be called once, by the factory, to set the group for which we are resolving privileges
 void setGrouperSession(GrouperSession s)
          Can only be called once, by the factory, to set the GrouperSession
 void setSubject(Subject subj)
          Can only be called once, by the factory, to set the subject for who we are resolving privileges
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultUIGroupPrivilegeResolver

public DefaultUIGroupPrivilegeResolver()
Method Detail

init

public void init()
Description copied from interface: UIGroupPrivilegeResolver
Called by the factory after group, subject and GrouperSession are set to allow any initialisation

Specified by:
init in interface UIGroupPrivilegeResolver

canEditGroup

public boolean canEditGroup()
Description copied from interface: UIGroupPrivilegeResolver
Is the subject allowed to edit core attributes or delete the group?

Specified by:
canEditGroup in interface UIGroupPrivilegeResolver
Returns:
if the Subject can edit group

canManageMembers

public boolean canManageMembers()
Description copied from interface: UIGroupPrivilegeResolver
Can the subject update the membership?

Specified by:
canManageMembers in interface UIGroupPrivilegeResolver
Returns:
if the Subject can manage members

canManagePrivileges

public boolean canManagePrivileges()
Description copied from interface: UIGroupPrivilegeResolver
Is the subject allowed to grant / revoke privileges?

Specified by:
canManagePrivileges in interface UIGroupPrivilegeResolver
Returns:
whether the Subject can manage privileges

canManageField

public boolean canManageField(String field)
Description copied from interface: UIGroupPrivilegeResolver
Can the subject modify the given field?

Specified by:
canManageField in interface UIGroupPrivilegeResolver
Returns:
whether the Subject can manage teh given field

canReadField

public boolean canReadField(String field)
Description copied from interface: UIGroupPrivilegeResolver
Can the subject read the given field?

Specified by:
canReadField in interface UIGroupPrivilegeResolver
Returns:
whether the Subject can read th egiven field

canManageAnyCustomField

public boolean canManageAnyCustomField()
Description copied from interface: UIGroupPrivilegeResolver
Can the subject change at least one custom attribute?

Specified by:
canManageAnyCustomField in interface UIGroupPrivilegeResolver
Returns:
if there are any custom attributes that the Subject can manage

canOptinGroup

public boolean canOptinGroup()
Description copied from interface: UIGroupPrivilegeResolver
Is the subject allowed to optin to the group?

Specified by:
canOptinGroup in interface UIGroupPrivilegeResolver
Returns:
whether the Subject can optin to the group

canOptoutGroup

public boolean canOptoutGroup()
Description copied from interface: UIGroupPrivilegeResolver
Is the subject allowed to optout of the group?

Specified by:
canOptoutGroup in interface UIGroupPrivilegeResolver
Returns:
whether the Subject can opt out of the group

canReadGroup

public boolean canReadGroup()
Description copied from interface: UIGroupPrivilegeResolver
Is the subject allowed to view the membership?

Specified by:
canReadGroup in interface UIGroupPrivilegeResolver
Returns:
whether the Subject can read the group

canViewGroup

public boolean canViewGroup()
Description copied from interface: UIGroupPrivilegeResolver
Is the subject allowed to view the group?

Specified by:
canViewGroup in interface UIGroupPrivilegeResolver
Returns:
whether the Subject can view the group

setGroup

public final void setGroup(Group g)
Description copied from interface: UIGroupPrivilegeResolver
Can only be called once, by the factory, to set the group for which we are resolving privileges

Specified by:
setGroup in interface UIGroupPrivilegeResolver

setGrouperSession

public void setGrouperSession(GrouperSession s)
Description copied from interface: UIGroupPrivilegeResolver
Can only be called once, by the factory, to set the GrouperSession

Specified by:
setGrouperSession in interface UIGroupPrivilegeResolver

setSubject

public void setSubject(Subject subj)
Description copied from interface: UIGroupPrivilegeResolver
Can only be called once, by the factory, to set the subject for who we are resolving privileges

Specified by:
setSubject in interface UIGroupPrivilegeResolver

asMap

public Map asMap()
Description copied from interface: UIGroupPrivilegeResolver
Convenience method to provide all possible 'answers' in a Map - which is strightforward for JSP/JSTL to 'query'. Keys are method names. canReadField and canWriteField use nested Maps. In JSTL ${groupPrivilegeResolver.canReadField['field']}

Specified by:
asMap in interface UIGroupPrivilegeResolver
Returns:
all privilege resolutions