Liferay 6.2-ce-ga5

com.liferay.portal.security.membershippolicy
Class BaseUserGroupMembershipPolicy

java.lang.Object
  extended by com.liferay.portal.security.membershippolicy.BaseUserGroupMembershipPolicy
All Implemented Interfaces:
UserGroupMembershipPolicy
Direct Known Subclasses:
DummyUserGroupMembershipPolicy

public abstract class BaseUserGroupMembershipPolicy
extends Object
implements UserGroupMembershipPolicy


Constructor Summary
BaseUserGroupMembershipPolicy()
           
 
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
 
Methods inherited from interface com.liferay.portal.security.membershippolicy.UserGroupMembershipPolicy
checkMembership, propagateMembership, verifyPolicy
 

Constructor Detail

BaseUserGroupMembershipPolicy

public BaseUserGroupMembershipPolicy()
Method Detail

isMembershipAllowed

public boolean isMembershipAllowed(long userId,
                                   long userGroupId)
                            throws PortalException,
                                   SystemException
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 - if a portal exception occurred
SystemException - if a system exception occurred

isMembershipRequired

public boolean isMembershipRequired(long userId,
                                    long userGroupId)
                             throws PortalException,
                                    SystemException
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 - if a portal exception occurred
SystemException - if a system exception occurred

verifyPolicy

public void verifyPolicy()
                  throws PortalException,
                         SystemException
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 - if a portal exception occurred
SystemException - if a system exception occurred

verifyPolicy

public void verifyPolicy(UserGroup userGroup)
                  throws PortalException,
                         SystemException
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 - if a portal exception occurred
SystemException - if a system exception occurred

Liferay 6.2-ce-ga5