public class AttributeDefPrivilegeDelegate extends Object
Modifier and Type | Method and Description |
---|---|
boolean |
canAttrAdmin(Subject subj)
Check whether the subject has ATTR_ADMIN on this attributeDef, or something else
that allows admin (well, actually, there isnt anything)
if (attributeDef.getPrivilegeDelegate().cabAttrAdmin(subj)) { // Has ATTR_ADMIN } else { // Does not have ATTR_ADMIN } |
boolean |
canAttrDefAttrRead(Subject subj)
Check whether the subject has ATTR_DEF_ATTR_READ on this attributeDef, or something else
that allows it (admin)
if (attributeDef.getPrivilegeDelegate().canAttrDefAttrRead(subj)) { // Has ATTR_DEF_ATTR_READ } else { // Does not have ATTR_DEF_ATTR_READ } |
boolean |
canAttrDefAttrUpdate(Subject subj)
Check whether the subject has ATTR_DEF_ATTR_UPDATE on this attributeDef, or something else
that allows it (admin)
if (attributeDef.getPrivilegeDelegate().canAttrDefAttrUpdate(subj)) { // Has ATTR_DEF_ATTR_UPDATE } else { // Does not have ATTR_DEF_ATTR_UPDATE } |
boolean |
canAttrOptin(Subject subj)
Check whether the subject has ATTR_OPTIN on this attributeDef, or something else
that allows read (well, actually there isnt anything else right now)
if (attributeDef.getPrivilegeDelegate().cabAttrOptin(subj)) { // Has ATTR_OPTIN } else { // Does not have ATTR_OPTIN } |
boolean |
canAttrOptout(Subject subj)
Check whether the subject has ATTR_OPTOUT on this attributeDef, or something else
that allows optout (well, actually, there isnt anything else right now)
if (attributeDef.getPrivilegeDelegate().cabAttrOptout(subj)) { // Has ATTR_OPTOUT } else { // Does not have ATTR_OPTOUT } |
boolean |
canAttrRead(Subject subj)
Check whether the subject has ATTR_READ on this attributeDef, or something else
that allows read (admin)
if (attributeDef.getPrivilegeDelegate().cabAttrRead(subj)) { // Has ATTR_READ } else { // Does not have ATTR_READ } |
boolean |
canAttrUpdate(Subject subj)
Check whether the subject has ATTR_UPDATE on this attributeDef, or something else
that allows update (admin)
if (attributeDef.getPrivilegeDelegate().cabAttrUpdate(subj)) { // Has ATTR_UPDATE } else { // Does not have ATTR_UPDATE } |
boolean |
canAttrView(Subject subj)
Check whether the subject has ATTR_VIEW on this attributeDef, or something else
that allows view (admin, read, update, etc)
if (attributeDef.getPrivilegeDelegate().cabAttrRead(subj)) { // Has ATTR_VIEW } else { // Does not have ATTR_VIEW } |
boolean |
canHavePrivilege(Subject subject,
String privilegeOrListName,
boolean secure)
see if the subject has a privilege or another privilege that implies this privilege.
|
boolean |
grantPriv(Subject subj,
Privilege priv,
boolean exceptionIfAlreadyMember)
Grant privilege to a subject on this attributeDef.
|
boolean |
grantPrivs(Subject subject,
boolean adminChecked,
boolean updateChecked,
boolean readChecked,
boolean viewChecked,
boolean optinChecked,
boolean optoutChecked,
boolean attrReadChecked,
boolean attrUpdateChecked,
boolean revokeIfUnchecked)
grant privs to attributedef
|
boolean |
hasAttrAdmin(Subject subj)
Check whether the subject has ATTR_ADMIN on this attributeDef.
|
boolean |
hasAttrDefAttrRead(Subject subj)
Check whether the subject has ATTR_DEF_ATTR_READ on this attributeDef.
|
boolean |
hasAttrDefAttrUpdate(Subject subj)
Check whether the subject has ATTR_DEF_ATTR_UPDATE on this attributeDef.
|
boolean |
hasAttrOptin(Subject subj)
Check whether the subject has ATTR_OPTIN on this attributeDef.
|
boolean |
hasAttrOptout(Subject subj)
Check whether the subject has ATTR_OPTOUT on this attributeDef.
|
boolean |
hasAttrRead(Subject subj)
Check whether the subject has ATTR_READ on this attributeDef.
|
boolean |
hasAttrUpdate(Subject subj)
Check whether the subject has ATTR_UPDATE on this attributeDef.
|
boolean |
hasAttrView(Subject subj)
Check whether the subject has ATTR_VIEW on this attributeDef.
|
boolean |
hasPrivilege(Subject subject,
String privilegeOrListName)
see if the subject has a privilege.
|
boolean |
internal_grantPriv(Subject subj,
Privilege priv,
boolean exceptionIfAlreadyMember,
String uuid)
Grant privilege to a subject on this attributeDef.
|
boolean |
revokePriv(Subject subj,
Privilege priv,
boolean exceptionIfAlreadyRevoked)
Revoke a privilege from the specified subject.
|
public boolean hasAttrAdmin(Subject subj)
if (attributeDef.getPrivilegeDelegate().hasAttrAdmin(subj)) { // Has ATTR_ADMIN } else { // Does not have ATTR_ADMIN }
subj
- Check this subject.public boolean hasAttrOptin(Subject subj)
if (attributeDef.getPrivilegeDelegate().hasAttrOptin(subj)) { // Has ATTR_OPTIN } else { // Does not have ATTR_OPTIN }
subj
- Check this subject.public boolean hasAttrOptout(Subject subj)
if (attributeDef.getPrivilegeDelegate().hasAttrOptout(subj)) { // Has ATTR_OPTOUT } else { // Does not have ATTR_OPTOUT }
subj
- Check this subject.public boolean hasAttrRead(Subject subj)
if (attributeDef.getPrivilegeDelegate().hasAttrRead(subj)) { // Has ATTR_READ } else { // Does not have ATTR_READ }
subj
- Check this subject.public boolean canAttrDefAttrUpdate(Subject subj)
if (attributeDef.getPrivilegeDelegate().canAttrDefAttrUpdate(subj)) { // Has ATTR_DEF_ATTR_UPDATE } else { // Does not have ATTR_DEF_ATTR_UPDATE }
subj
- Check this subject.public boolean canAttrDefAttrRead(Subject subj)
if (attributeDef.getPrivilegeDelegate().canAttrDefAttrRead(subj)) { // Has ATTR_DEF_ATTR_READ } else { // Does not have ATTR_DEF_ATTR_READ }
subj
- Check this subject.public boolean hasAttrDefAttrRead(Subject subj)
if (attributeDef.getPrivilegeDelegate().hasAttrDefAttrRead(subj)) { // Has ATTR_DEF_ATTR_READ } else { // Does not have ATTR_DEF_ATTR_READ }
subj
- Check this subject.public boolean hasAttrDefAttrUpdate(Subject subj)
if (attributeDef.getPrivilegeDelegate().hasAttrDefAttrUpdate(subj)) { // Has ATTR_DEF_ATTR_UPDATE } else { // Does not have ATTR_DEF_ATTR_UPDATE }
subj
- Check this subject.public boolean hasAttrUpdate(Subject subj)
if (attributeDef.getPrivilegeDelegate().hasAttrUpdate(subj)) { // Has ATTR_UPDATE } else { // Does not have ATTR_UPDATE }
subj
- Check this subject.public boolean hasAttrView(Subject subj)
if (attributeDef.getPrivilegeDelegate().hasAttrView(subj)) { // Has ATTR_VIEW } else { // Does not have ATTR_VIEW }
subj
- Check this subject.public boolean grantPriv(Subject subj, Privilege priv, boolean exceptionIfAlreadyMember) throws GrantPrivilegeException, InsufficientPrivilegeException, SchemaException
try { attributeDef.getPrivilegeDelegate().grantPriv(subj, AttributeDefPrivilege.ATTR_ADMIN); } catch (GrantPrivilegeException e0) { // Cannot grant this privilege } catch (InsufficientPrivilegeException e1) { // Unable to grant this privilege }
subj
- Grant privilege to this subject.priv
- Grant this privilege.exceptionIfAlreadyMember
- if false, and subject is already a member,
then dont throw a MemberAddException if the member is already in the listGrantPrivilegeException
InsufficientPrivilegeException
SchemaException
public boolean grantPrivs(Subject subject, boolean adminChecked, boolean updateChecked, boolean readChecked, boolean viewChecked, boolean optinChecked, boolean optoutChecked, boolean attrReadChecked, boolean attrUpdateChecked, boolean revokeIfUnchecked)
subject
- to addupdateChecked
- adminChecked
- readChecked
- viewChecked
- optinChecked
- optoutChecked
- attrReadChecked
- attrUpdateChecked
- revokeIfUnchecked
- public boolean internal_grantPriv(Subject subj, Privilege priv, boolean exceptionIfAlreadyMember, String uuid) throws GrantPrivilegeException, InsufficientPrivilegeException, SchemaException
try { attributeDef.getPrivilegeDelegate().grantPriv(subj, AttributeDefPrivilege.ATTR_ADMIN); } catch (GrantPrivilegeException e0) { // Cannot grant this privilege } catch (InsufficientPrivilegeException e1) { // Unable to grant this privilege }
subj
- Grant privilege to this subject.priv
- Grant this privilege.exceptionIfAlreadyMember
- if false, and subject is already a member,
then dont throw a MemberAddException if the member is already in the listuuid
- is uuid or null for assignedGrantPrivilegeException
InsufficientPrivilegeException
SchemaException
public boolean revokePriv(Subject subj, Privilege priv, boolean exceptionIfAlreadyRevoked) throws InsufficientPrivilegeException, RevokePrivilegeException, SchemaException
try { g.getPrivilegeDelegate().revokePriv(subj, AttributeDefPrivilege.ATTR_ADMIN); } catch (InsufficientPrivilegeException e1) { // Not privileged to revoke this privilege } catch (RevokePrivilegeException eRP) { // Error revoking privilege }
subj
- Revoke privilege from this subject.priv
- Revoke this privilege.exceptionIfAlreadyRevoked
- if false, and subject is already a member,
then dont throw a MemberAddException if the member is already in the listInsufficientPrivilegeException
RevokePrivilegeException
SchemaException
public boolean canAttrRead(Subject subj)
if (attributeDef.getPrivilegeDelegate().cabAttrRead(subj)) { // Has ATTR_READ } else { // Does not have ATTR_READ }
subj
- Check this subject.public boolean canAttrView(Subject subj)
if (attributeDef.getPrivilegeDelegate().cabAttrRead(subj)) { // Has ATTR_VIEW } else { // Does not have ATTR_VIEW }
subj
- Check this subject.public boolean canAttrUpdate(Subject subj)
if (attributeDef.getPrivilegeDelegate().cabAttrUpdate(subj)) { // Has ATTR_UPDATE } else { // Does not have ATTR_UPDATE }
subj
- Check this subject.public boolean canAttrAdmin(Subject subj)
if (attributeDef.getPrivilegeDelegate().cabAttrAdmin(subj)) { // Has ATTR_ADMIN } else { // Does not have ATTR_ADMIN }
subj
- Check this subject.public boolean hasPrivilege(Subject subject, String privilegeOrListName)
subject
- privilegeOrListName
- public boolean canAttrOptin(Subject subj)
if (attributeDef.getPrivilegeDelegate().cabAttrOptin(subj)) { // Has ATTR_OPTIN } else { // Does not have ATTR_OPTIN }
subj
- Check this subject.public boolean canAttrOptout(Subject subj)
if (attributeDef.getPrivilegeDelegate().cabAttrOptout(subj)) { // Has ATTR_OPTOUT } else { // Does not have ATTR_OPTOUT }
subj
- Check this subject.public boolean canHavePrivilege(Subject subject, String privilegeOrListName, boolean secure)
subject
- privilegeOrListName
- secure
- if the user must be an admin to checkCopyright © 2016 Internet2. All rights reserved.