Class MembershipCannotAddSelfToGroupHook
java.lang.Object
edu.internet2.middleware.grouper.hooks.MembershipHooks
edu.internet2.middleware.grouper.hooks.examples.MembershipCannotAddSelfToGroupHook
Hook allows only one membership in a folder at a time
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
put this attribute on a folder to ensure there is one membership only for any group in folderFields inherited from class edu.internet2.middleware.grouper.hooks.MembershipHooks
METHOD_MEMBERSHIP_POST_ADD_MEMBER, METHOD_MEMBERSHIP_POST_COMMIT_ADD_MEMBER, METHOD_MEMBERSHIP_POST_COMMIT_DELETE, METHOD_MEMBERSHIP_POST_COMMIT_INSERT, METHOD_MEMBERSHIP_POST_COMMIT_REMOVE_MEMBER, METHOD_MEMBERSHIP_POST_COMMIT_UPDATE, METHOD_MEMBERSHIP_POST_DELETE, METHOD_MEMBERSHIP_POST_INSERT, METHOD_MEMBERSHIP_POST_REMOVE_MEMBER, METHOD_MEMBERSHIP_POST_UPDATE, METHOD_MEMBERSHIP_PRE_ADD_MEMBER, METHOD_MEMBERSHIP_PRE_DELETE, METHOD_MEMBERSHIP_PRE_INSERT, METHOD_MEMBERSHIP_PRE_REMOVE_MEMBER, METHOD_MEMBERSHIP_PRE_UPDATE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
cannotAddSelfAssign
(Group group) assign the attribute to the group which means cannot add selfstatic boolean
if the current group has cannotAddSelfstatic String
users who can assign "cannot add self"static AttributeDefName
attribute def name for "cannot add self"static boolean
if this feature is enabledstatic String
attribute def for "cannot add self"static String
attribute def name for "cannot add self"static boolean
cannotAddSelfRevoke
(Group group) revoke the attribute to the group which means cannot add selfstatic String
users who can revoke "cannot add self"static String
base stem for these attributes (just in hooks folder)static boolean
cannotAddSelfUserCanEdit
(Group group, Subject subject) if the current user can assign cannotAddSelfstatic boolean
cannotAddSelfUserCanView
(Group group, Subject subject) if the current user can assign cannotAddSelfstatic void
void
membershipPreAddMember
(HooksContext hooksContext, HooksMembershipChangeBean preAddMemberBean) called right before a membership update (high level, not the side effects)static void
see if this is configured in the grouper.properties, if so, register this hookMethods inherited from class edu.internet2.middleware.grouper.hooks.MembershipHooks
membershipPostAddMember, membershipPostCommitAddMember, membershipPostCommitDelete, membershipPostCommitInsert, membershipPostCommitRemoveMember, membershipPostCommitUpdate, membershipPostDelete, membershipPostInsert, membershipPostRemoveMember, membershipPostUpdate, membershipPreDelete, membershipPreInsert, membershipPreRemoveMember, membershipPreUpdate
-
Field Details
-
HOOK_VETO_CANNOT_ADD_SELF_TO_GROUP
- See Also:
-
membershipOneFolderExtensionOfAttributeDefName
put this attribute on a folder to ensure there is one membership only for any group in folder- See Also:
-
-
Constructor Details
-
MembershipCannotAddSelfToGroupHook
public MembershipCannotAddSelfToGroupHook()
-
-
Method Details
-
clearHook
public static void clearHook() -
cannotAddSelfEnabled
public static boolean cannotAddSelfEnabled()if this feature is enabled- Returns:
- true if enabled
-
cannotAddSelfAssignedToGroup
if the current group has cannotAddSelf- Parameters:
group
- group to check- Returns:
- if assigned to group
-
cannotAddSelfAssign
assign the attribute to the group which means cannot add self- Parameters:
group
-- Returns:
- if the value was assigned
-
cannotAddSelfRevoke
revoke the attribute to the group which means cannot add self- Parameters:
group
-- Returns:
- if the value was revoked
-
cannotAddSelfUserCanEdit
if the current user can assign cannotAddSelf- Parameters:
group
- the group to checksubject
- the subject to check- Returns:
- is can optin
-
cannotAddSelfUserCanView
if the current user can assign cannotAddSelf- Parameters:
group
- the group to checksubject
- the subject to check- Returns:
- is can optin
-
cannotAddSelfStemName
base stem for these attributes (just in hooks folder)- Returns:
- the stem name
-
cannotAddSelfAssignGroupName
users who can assign "cannot add self"- Returns:
- the group name
-
cannotAddSelfRevokeGroupName
users who can revoke "cannot add self"- Returns:
- the group name
-
cannotAddSelfNameOfAttributeDef
attribute def for "cannot add self"- Returns:
- the group name
-
cannotAddSelfNameOfAttributeDefName
attribute def name for "cannot add self"- Returns:
- the group name
-
cannotAddSelfAttributeDefName
attribute def name for "cannot add self"- Returns:
- the group name
-
membershipPreAddMember
public void membershipPreAddMember(HooksContext hooksContext, HooksMembershipChangeBean preAddMemberBean) Description copied from class:MembershipHooks
called right before a membership update (high level, not the side effects) -
registerHookIfNecessary
public static void registerHookIfNecessary()see if this is configured in the grouper.properties, if so, register this hook
-