Class MembershipCannotAddSelfToGroupHook

java.lang.Object
edu.internet2.middleware.grouper.hooks.MembershipHooks
edu.internet2.middleware.grouper.hooks.examples.MembershipCannotAddSelfToGroupHook

public class MembershipCannotAddSelfToGroupHook extends MembershipHooks
Hook allows only one membership in a folder at a time
  • Field Details

    • HOOK_VETO_CANNOT_ADD_SELF_TO_GROUP

      public static final String HOOK_VETO_CANNOT_ADD_SELF_TO_GROUP
      See Also:
    • membershipOneFolderExtensionOfAttributeDefName

      public static final String 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

      public static boolean cannotAddSelfAssignedToGroup(Group group)
      if the current group has cannotAddSelf
      Parameters:
      group - group to check
      Returns:
      if assigned to group
    • cannotAddSelfAssign

      public static boolean cannotAddSelfAssign(Group group)
      assign the attribute to the group which means cannot add self
      Parameters:
      group -
      Returns:
      if the value was assigned
    • cannotAddSelfRevoke

      public static boolean cannotAddSelfRevoke(Group group)
      revoke the attribute to the group which means cannot add self
      Parameters:
      group -
      Returns:
      if the value was revoked
    • cannotAddSelfUserCanEdit

      public static boolean cannotAddSelfUserCanEdit(Group group, Subject subject)
      if the current user can assign cannotAddSelf
      Parameters:
      group - the group to check
      subject - the subject to check
      Returns:
      is can optin
    • cannotAddSelfUserCanView

      public static boolean cannotAddSelfUserCanView(Group group, Subject subject)
      if the current user can assign cannotAddSelf
      Parameters:
      group - the group to check
      subject - the subject to check
      Returns:
      is can optin
    • cannotAddSelfStemName

      public static String cannotAddSelfStemName()
      base stem for these attributes (just in hooks folder)
      Returns:
      the stem name
    • cannotAddSelfAssignGroupName

      public static String cannotAddSelfAssignGroupName()
      users who can assign "cannot add self"
      Returns:
      the group name
    • cannotAddSelfRevokeGroupName

      public static String cannotAddSelfRevokeGroupName()
      users who can revoke "cannot add self"
      Returns:
      the group name
    • cannotAddSelfNameOfAttributeDef

      public static String cannotAddSelfNameOfAttributeDef()
      attribute def for "cannot add self"
      Returns:
      the group name
    • cannotAddSelfNameOfAttributeDefName

      public static String cannotAddSelfNameOfAttributeDefName()
      attribute def name for "cannot add self"
      Returns:
      the group name
    • cannotAddSelfAttributeDefName

      public static AttributeDefName 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)
      Overrides:
      membershipPreAddMember in class MembershipHooks
      See Also:
    • registerHookIfNecessary

      public static void registerHookIfNecessary()
      see if this is configured in the grouper.properties, if so, register this hook