|
Liferay 6.2-ce-ga5 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.liferay.portal.security.membershippolicy.BaseSiteMembershipPolicy
public abstract class BaseSiteMembershipPolicy
Constructor Summary | |
---|---|
BaseSiteMembershipPolicy()
|
Method Summary | |
---|---|
void |
checkRoles(List<UserGroupRole> addUserGroupRoles,
List<UserGroupRole> removeUserGroupRoles)
Checks if the site roles can be added to or removed from their users. |
boolean |
isMembershipAllowed(long userId,
long groupId)
Returns true if the user can be added to the site. |
boolean |
isMembershipProtected(PermissionChecker permissionChecker,
long userId,
long groupId)
Returns true if the policy prevents the user from being
removed from the site by the user associated with the permission checker. |
boolean |
isMembershipRequired(long userId,
long groupId)
Returns true if site membership for the user is mandatory. |
boolean |
isRoleAllowed(long userId,
long groupId,
long roleId)
Returns true if the role can be added to the user on the
site. |
boolean |
isRoleProtected(PermissionChecker permissionChecker,
long userId,
long groupId,
long roleId)
Returns true if the policy prevents the user from being
removed from the role by the user associated with the permission checker. |
boolean |
isRoleRequired(long userId,
long groupId,
long roleId)
Returns true if the role is mandatory for the user on the
site. |
void |
propagateRoles(List<UserGroupRole> addUserGroupRoles,
List<UserGroupRole> removeUserGroupRoles)
Performs membership policy related actions after the respective site roles are added to and removed from the affected users. |
void |
verifyPolicy()
Checks the integrity of the membership policy of each of the portal's sites and performs operations necessary for the compliance of each site and site role. |
void |
verifyPolicy(Group group)
Checks the integrity of the membership policy of the site and performs operations necessary for the site's compliance. |
void |
verifyPolicy(Role role)
Checks the integrity of the membership policy of the site role and performs operations necessary for the role's compliance. |
void |
verifyPolicy(Role role,
Role oldRole,
Map<String,Serializable> oldExpandoAttributes)
Checks the integrity of the membership policy of the site role, with respect to its expando attributes, and performs operations necessary for the role'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.SiteMembershipPolicy |
---|
checkMembership, propagateMembership, verifyPolicy |
Constructor Detail |
---|
public BaseSiteMembershipPolicy()
Method Detail |
---|
public void checkRoles(List<UserGroupRole> addUserGroupRoles, List<UserGroupRole> removeUserGroupRoles) throws PortalException, SystemException
SiteMembershipPolicy
Liferay's core services call this method before adding the users to and removing the users from the respective site roles. If this method throws an exception, the service foregoes making the changes.
checkRoles
in interface SiteMembershipPolicy
addUserGroupRoles
- the user group roles to be addedremoveUserGroupRoles
- the user group roles to be removed
PortalException
- if any one user group role violated the policy or
if a portal exception occurred
SystemException
- if a system exception occurredpublic boolean isMembershipAllowed(long userId, long groupId) throws PortalException, SystemException
SiteMembershipPolicy
true
if the user can be added to the site. Liferay's
UI calls this method.
isMembershipAllowed
in interface SiteMembershipPolicy
userId
- the primary key of the usergroupId
- the primary key of the site
true
if the user can be added to the site;
false
otherwise
PortalException
- if a portal exception occurred
SystemException
- if a system exception occurredpublic boolean isMembershipProtected(PermissionChecker permissionChecker, long userId, long groupId) throws PortalException, SystemException
SiteMembershipPolicy
true
if the policy prevents the user from being
removed from the site by the user associated with the permission checker.
isMembershipProtected
in interface SiteMembershipPolicy
permissionChecker
- the permission checker referencing a useruserId
- the primary key of the user to check for protectiongroupId
- the primary key of the site
true
if the policy prevents the user from being
removed from the site by the user associated with the permission
checker; false
otherwise
PortalException
- if a portal exception occurred
SystemException
- if a system exception occurredpublic boolean isMembershipRequired(long userId, long groupId) throws PortalException, SystemException
SiteMembershipPolicy
true
if site membership for the user is mandatory.
Liferay's UI, for example, calls this method in deciding whether to
display the option to leave the site.
isMembershipRequired
in interface SiteMembershipPolicy
userId
- the primary key of the usergroupId
- the primary key of the site
true
if site membership for the user is mandatory;
false
otherwise
PortalException
- if a portal exception occurred
SystemException
- if a system exception occurredpublic boolean isRoleAllowed(long userId, long groupId, long roleId) throws PortalException, SystemException
SiteMembershipPolicy
true
if the role can be added to the user on the
site. Liferay's UI calls this method.
isRoleAllowed
in interface SiteMembershipPolicy
userId
- the primary key of the usergroupId
- the primary key of the siteroleId
- the primary key of the role
true
if the role can be added to the user on the
site; false
otherwise
PortalException
- if a portal exception occurred
SystemException
- if a system exception occurredpublic boolean isRoleProtected(PermissionChecker permissionChecker, long userId, long groupId, long roleId) throws PortalException, SystemException
SiteMembershipPolicy
true
if the policy prevents the user from being
removed from the role by the user associated with the permission checker.
isRoleProtected
in interface SiteMembershipPolicy
permissionChecker
- the permission checker referencing a useruserId
- the primary key of the user to check for protectiongroupId
- the primary key of the siteroleId
- the primary key of the role
true
if the policy prevents the user from being
removed from the role by the user associated with the permission
checker; false
otherwise
PortalException
- if a portal exception occurred
SystemException
- if a system exception occurredpublic boolean isRoleRequired(long userId, long groupId, long roleId)
SiteMembershipPolicy
true
if the role is mandatory for the user on the
site. Liferay's UI calls this method.
isRoleRequired
in interface SiteMembershipPolicy
userId
- the primary key of the usergroupId
- the primary key of the siteroleId
- the primary key of the role
true
if the role is mandatory for the user on the
site; false
otherwisepublic void propagateRoles(List<UserGroupRole> addUserGroupRoles, List<UserGroupRole> removeUserGroupRoles) throws PortalException, SystemException
SiteMembershipPolicy
The actions must ensure the membership policy of each site role. For example, some actions for implementations to consider performing are:
propagateRoles
in interface SiteMembershipPolicy
addUserGroupRoles
- the user group roles addedremoveUserGroupRoles
- the user group roles removed
PortalException
- if a portal exception occurred
SystemException
- if a system exception occurredpublic void verifyPolicy() throws PortalException, SystemException
SiteMembershipPolicy
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 SiteMembershipPolicy
PortalException
- if a portal exception occurred
SystemException
- if a system exception occurredpublic void verifyPolicy(Group group) throws PortalException, SystemException
SiteMembershipPolicy
verifyPolicy
in interface SiteMembershipPolicy
group
- the site to verify
PortalException
- if a portal exception occurred
SystemException
- if a system exception occurredpublic void verifyPolicy(Role role)
SiteMembershipPolicy
verifyPolicy
in interface SiteMembershipPolicy
role
- the role to verifypublic void verifyPolicy(Role role, Role oldRole, Map<String,Serializable> oldExpandoAttributes)
SiteMembershipPolicy
verifyPolicy
in interface SiteMembershipPolicy
role
- the added or updated role to verifyoldRole
- the old roleoldExpandoAttributes
- the old expando attributes
|
Liferay 6.2-ce-ga5 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |