|
Liferay 7.0-ce-b4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.liferay.portal.security.membershippolicy.BaseOrganizationMembershipPolicy
com.liferay.portal.security.membershippolicy.DummyOrganizationMembershipPolicy
public class DummyOrganizationMembershipPolicy
| Constructor Summary | |
|---|---|
DummyOrganizationMembershipPolicy()
|
|
| Method Summary | |
|---|---|
void |
checkMembership(long[] userIds,
long[] addOrganizationIds,
long[] removeOrganizationIds)
Checks if the users can be added to and removed from the respective organizations. |
boolean |
isMembershipAllowed(long userId,
long groupId)
Returns true if the user can be added to the organization. |
boolean |
isMembershipRequired(long userId,
long groupId)
Returns true if organization 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
organization. |
boolean |
isRoleRequired(long userId,
long groupId,
long roleId)
Returns true if the role is mandatory for the user on the
organization. |
void |
propagateMembership(long[] userIds,
long[] addOrganizationIds,
long[] removeOrganizationIds)
Performs membership policy related actions after the users are added to and removed from the respective organizations. |
void |
verifyPolicy(Organization organization)
Checks the integrity of the membership policy of the organization and performs operations necessary for the organization's compliance. |
void |
verifyPolicy(Organization organization,
Organization oldOrganization,
List<AssetCategory> oldAssetCategories,
List<AssetTag> oldAssetTags,
Map<String,Serializable> oldExpandoAttributes)
Checks the integrity of the membership policy of the organization, with respect to the organization's new attribute values, categories, tags, and expando attributes, and performs operations necessary for the compliance of the organization and its organization roles. |
| Methods inherited from class com.liferay.portal.security.membershippolicy.BaseOrganizationMembershipPolicy |
|---|
checkRoles, isMembershipProtected, isRoleProtected, propagateRoles, verifyPolicy, verifyPolicy, verifyPolicy |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DummyOrganizationMembershipPolicy()
| Method Detail |
|---|
public void checkMembership(long[] userIds,
long[] addOrganizationIds,
long[] removeOrganizationIds)
OrganizationMembershipPolicyLiferay's core services call this method before adding the users to and removing the users from the respective organizations. If this method throws an exception, the service foregoes making the changes.
userIds - the primary keys of the users to be added and removed from
the organizationsaddOrganizationIds - the primary keys of the organizations to which
the users are to be added (optionally null)removeOrganizationIds - the primary keys of the organizations from
which the users are to be removed (optionally null)
public boolean isMembershipAllowed(long userId,
long groupId)
OrganizationMembershipPolicytrue if the user can be added to the organization.
Liferay's UI calls this method.
isMembershipAllowed in interface OrganizationMembershipPolicyisMembershipAllowed in class BaseOrganizationMembershipPolicyuserId - the primary key of the usergroupId - the primary key of the organization
true if the user can be added to the organization;
false otherwise
public boolean isMembershipRequired(long userId,
long groupId)
OrganizationMembershipPolicytrue if organization membership for the user is
mandatory. Liferay's UI, for example, calls this method in deciding
whether to enable the checkbox for removing the user from the
organization.
isMembershipRequired in interface OrganizationMembershipPolicyisMembershipRequired in class BaseOrganizationMembershipPolicyuserId - the primary key of the usergroupId - the primary key of the organization
true if organization membership for the user is
mandatory; false otherwise
public boolean isRoleAllowed(long userId,
long groupId,
long roleId)
OrganizationMembershipPolicytrue if the role can be added to the user on the
organization. Liferay's UI calls this method.
isRoleAllowed in interface OrganizationMembershipPolicyisRoleAllowed in class BaseOrganizationMembershipPolicyuserId - the primary key of the usergroupId - the primary key of the organizationroleId - the primary key of the role
true if the role can be added to the user on the
organization; false otherwise
public boolean isRoleRequired(long userId,
long groupId,
long roleId)
OrganizationMembershipPolicytrue if the role is mandatory for the user on the
organization. Liferay's UI calls this method.
isRoleRequired in interface OrganizationMembershipPolicyisRoleRequired in class BaseOrganizationMembershipPolicyuserId - the primary key of the usergroupId - the primary key of the organizationroleId - the primary key of the role
true if the role is mandatory for the user on the
organization; false otherwise
public void propagateMembership(long[] userIds,
long[] addOrganizationIds,
long[] removeOrganizationIds)
OrganizationMembershipPolicyThe actions must ensure the integrity of each organization's membership policy. For example, some actions for implementations to consider performing are:
userIds - the primary key of the users to be added or removedaddOrganizationIds - the primary keys of the organizations to which
the users were added (optionally null)removeOrganizationIds - the primary keys of the organizations from
which the users were removed (optionally null)public void verifyPolicy(Organization organization)
OrganizationMembershipPolicy
verifyPolicy in interface OrganizationMembershipPolicyverifyPolicy in class BaseOrganizationMembershipPolicyorganization - the organization to verify
public void verifyPolicy(Organization organization,
Organization oldOrganization,
List<AssetCategory> oldAssetCategories,
List<AssetTag> oldAssetTags,
Map<String,Serializable> oldExpandoAttributes)
OrganizationMembershipPolicyThe actions must ensure the integrity of the organization's membership policy based on what has changed in the organization's attribute values, categories, tags, and expando attributes.
For example, if the membership policy is that organizations with the "admnistrator" tag should only allow administrators as users, then this method could enforce that policy using the following logic:
assetTagLocalService.getTags(Group.class.getName(),
group.getGroupId());.
organization - the added or updated organization to verifyoldOrganization - the old organizationoldAssetCategories - the old categoriesoldAssetTags - the old tagsoldExpandoAttributes - the old expando attributes
|
Liferay 7.0-ce-b4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||