Class BaseRoleMembershipPolicy
Object
com.liferay.portal.kernel.security.membershippolicy.BaseRoleMembershipPolicy
- All Implemented Interfaces:
RoleMembershipPolicy
- Direct Known Subclasses:
DummyRoleMembershipPolicy
- Author:
- Roberto Díaz, Sergio González
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisRoleAllowed(long userId, long roleId) Returnstrueif the role can be added to the user.booleanisRoleRequired(long userId, long roleId) Returnstrueif the role is mandatory for the user.voidChecks the integrity of the membership policy of each of the portal's roles and performs operations necessary for the compliance of each role.voidverifyPolicy(Role role) Checks the integrity of the membership policy of the role and performs operations necessary for the compliance of the role.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.liferay.portal.kernel.security.membershippolicy.RoleMembershipPolicy
checkRoles, propagateRoles, verifyPolicy
-
Constructor Details
-
BaseRoleMembershipPolicy
public BaseRoleMembershipPolicy()
-
-
Method Details
-
isRoleAllowed
Description copied from interface:RoleMembershipPolicyReturnstrueif the role can be added to the user. Liferay's UI calls this method.- Specified by:
isRoleAllowedin interfaceRoleMembershipPolicy- Parameters:
userId- the primary key of the userroleId- the primary key of the role- Returns:
trueif the role can be added to the user;falseotherwise- Throws:
PortalException
-
isRoleRequired
Description copied from interface:RoleMembershipPolicyReturnstrueif the role is mandatory for the user. Liferay's UI, for example, calls this method in deciding whether the checkbox to select a role will be enable.- Specified by:
isRoleRequiredin interfaceRoleMembershipPolicy- Parameters:
userId- the primary key of the userroleId- the primary key of the role- Returns:
trueif the role is mandatory for the user;falseotherwise- Throws:
PortalException
-
verifyPolicy
Description copied from interface:RoleMembershipPolicyChecks the integrity of the membership policy of each of the portal's roles and performs operations necessary for the compliance of each role. This method can be triggered manually from the Control Panel. If themembership.policy.auto.verifyportal property istruethis method is triggered when starting Liferay and every time a membership policy hook is deployed.- Specified by:
verifyPolicyin interfaceRoleMembershipPolicy- Throws:
PortalException
-
verifyPolicy
Description copied from interface:RoleMembershipPolicyChecks the integrity of the membership policy of the role and performs operations necessary for the compliance of the role.- Specified by:
verifyPolicyin interfaceRoleMembershipPolicy- Parameters:
role- the role to verify- Throws:
PortalException
-