public abstract class BaseUserGroupMembershipPolicy extends Object implements UserGroupMembershipPolicy
Constructor and Description |
---|
BaseUserGroupMembershipPolicy() |
Modifier and Type | Method and Description |
---|---|
boolean |
isMembershipAllowed(long userId,
long userGroupId)
Returns
true if the user can be added to the user group. |
boolean |
isMembershipRequired(long userId,
long userGroupId)
Returns
true if user group membership for the user is
mandatory. |
void |
verifyPolicy()
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkMembership, propagateMembership, verifyPolicy
public boolean isMembershipAllowed(long userId, long userGroupId) throws PortalException
UserGroupMembershipPolicy
true
if the user can be added to the user group.
Liferay's UI calls this method.isMembershipAllowed
in interface UserGroupMembershipPolicy
userId
- the primary key of the useruserGroupId
- the primary key of the user grouptrue
if the user can be added to the user group;
false
otherwisePortalException
public boolean isMembershipRequired(long userId, long userGroupId) throws PortalException
UserGroupMembershipPolicy
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.isMembershipRequired
in interface UserGroupMembershipPolicy
userId
- the primary key of the useruserGroupId
- the primary key of the user grouptrue
if user group membership for the user is
mandatory; false
otherwisePortalException
public void verifyPolicy() throws PortalException
UserGroupMembershipPolicy
membership.policy.auto.verify
portal property is
true
this method is triggered when starting Liferay and
every time a membership policy hook is deployed.verifyPolicy
in interface UserGroupMembershipPolicy
PortalException
public void verifyPolicy(UserGroup userGroup) throws PortalException
UserGroupMembershipPolicy
verifyPolicy
in interface UserGroupMembershipPolicy
userGroup
- the user group to verifyPortalException