com.liferay.portal.security.membershippolicy
Class BaseUserGroupMembershipPolicy
java.lang.Object
com.liferay.portal.security.membershippolicy.BaseUserGroupMembershipPolicy
- All Implemented Interfaces:
- UserGroupMembershipPolicy
- Direct Known Subclasses:
- DummyUserGroupMembershipPolicy
public abstract class BaseUserGroupMembershipPolicy
- extends Object
- implements UserGroupMembershipPolicy
|
Method Summary |
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BaseUserGroupMembershipPolicy
public BaseUserGroupMembershipPolicy()
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 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
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 useruserGroupId - 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