Class BaseUserGroupMembershipPolicy

Object
com.liferay.portal.kernel.security.membershippolicy.BaseUserGroupMembershipPolicy
All Implemented Interfaces:
UserGroupMembershipPolicy
Direct Known Subclasses:
DummyUserGroupMembershipPolicy

public abstract class BaseUserGroupMembershipPolicy extends Object implements UserGroupMembershipPolicy
Author:
Roberto Díaz, Sergio González
  • Constructor Details

    • BaseUserGroupMembershipPolicy

      public BaseUserGroupMembershipPolicy()
  • Method Details

    • isMembershipAllowed

      public boolean isMembershipAllowed(long userId, long userGroupId) throws PortalException
      Description copied from interface: UserGroupMembershipPolicy
      Returns true if the user can be added to the user group. Liferay's UI calls this method.
      Specified by:
      isMembershipAllowed in interface UserGroupMembershipPolicy
      Parameters:
      userId - the primary key of the user
      userGroupId - the primary key of the user group
      Returns:
      true if the user can be added to the user group; false otherwise
      Throws:
      PortalException
    • isMembershipRequired

      public boolean isMembershipRequired(long userId, long userGroupId) throws PortalException
      Description copied from interface: UserGroupMembershipPolicy
      Returns true if user group membership for the user is mandatory. Liferay's UI, for example, calls this method in deciding whether the checkbox to select the user group will be enable.
      Specified by:
      isMembershipRequired in interface UserGroupMembershipPolicy
      Parameters:
      userId - the primary key of the user
      userGroupId - the primary key of the user group
      Returns:
      true if user group membership for the user is mandatory; false otherwise
      Throws:
      PortalException
    • verifyPolicy

      public void verifyPolicy() throws PortalException
      Description copied from interface: UserGroupMembershipPolicy
      Checks the integrity of the membership policy of each of the portal's user groups and performs operations necessary for the compliance of each user group. This method can be triggered manually from the Control Panel. If the membership.policy.auto.verify portal property is true this method is triggered when starting Liferay and every time a membership policy hook is deployed.
      Specified by:
      verifyPolicy in interface UserGroupMembershipPolicy
      Throws:
      PortalException
    • verifyPolicy

      public void verifyPolicy(UserGroup userGroup) throws PortalException
      Description copied from interface: UserGroupMembershipPolicy
      Checks the integrity of the membership policy of the user group and performs operations necessary for the user group's compliance.
      Specified by:
      verifyPolicy in interface UserGroupMembershipPolicy
      Parameters:
      userGroup - the user group to verify
      Throws:
      PortalException