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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
isMembershipAllowed
(long userId, long userGroupId) Returnstrue
if the user can be added to the user group.boolean
isMembershipRequired
(long userId, long userGroupId) Returnstrue
if user group membership for the user is mandatory.void
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.void
verifyPolicy
(UserGroup userGroup) Checks the integrity of the membership policy of the user group and performs operations necessary for the user group's compliance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.liferay.portal.kernel.security.membershippolicy.UserGroupMembershipPolicy
checkMembership, propagateMembership, verifyPolicy
-
Constructor Details
-
BaseUserGroupMembershipPolicy
public BaseUserGroupMembershipPolicy()
-
-
Method Details
-
isMembershipAllowed
Description copied from interface:UserGroupMembershipPolicy
Returnstrue
if the user can be added to the user group. Liferay's UI calls this method.- Specified by:
isMembershipAllowed
in interfaceUserGroupMembershipPolicy
- Parameters:
userId
- the primary key of the useruserGroupId
- the primary key of the user group- Returns:
true
if the user can be added to the user group;false
otherwise- Throws:
PortalException
-
isMembershipRequired
Description copied from interface:UserGroupMembershipPolicy
Returnstrue
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 interfaceUserGroupMembershipPolicy
- Parameters:
userId
- the primary key of the useruserGroupId
- the primary key of the user group- Returns:
true
if user group membership for the user is mandatory;false
otherwise- Throws:
PortalException
-
verifyPolicy
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 themembership.policy.auto.verify
portal property istrue
this method is triggered when starting Liferay and every time a membership policy hook is deployed.- Specified by:
verifyPolicy
in interfaceUserGroupMembershipPolicy
- Throws:
PortalException
-
verifyPolicy
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 interfaceUserGroupMembershipPolicy
- Parameters:
userGroup
- the user group to verify- Throws:
PortalException
-