|
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.BaseSiteMembershipPolicy
com.liferay.portal.security.membershippolicy.DummySiteMembershipPolicy
public class DummySiteMembershipPolicy
| Constructor Summary | |
|---|---|
DummySiteMembershipPolicy()
|
|
| Method Summary | |
|---|---|
void |
checkMembership(long[] userIds,
long[] addGroupIds,
long[] removeGroupIds)
Checks if the users can be added to and removed from the respective sites. |
boolean |
isMembershipAllowed(long userId,
long groupId)
Returns true if the user can be added to the site. |
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 |
isRoleRequired(long userId,
long groupId,
long roleId)
Returns true if the role is mandatory for the user on the
site. |
void |
propagateMembership(long[] userIds,
long[] addGroupIds,
long[] removeGroupIds)
Performs membership policy related actions after the users are added to and removed from the respective sites. |
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(Group group,
Group oldGroup,
List<AssetCategory> oldAssetCategories,
List<AssetTag> oldAssetTags,
Map<String,Serializable> oldExpandoAttributes,
UnicodeProperties oldTypeSettingsProperties)
Checks the integrity of the membership policy of the site, with respect to the site's new attribute values, categories, tags, expando attributes, and type settings properties, and performs operations necessary for the compliance of the site and its site roles. |
| Methods inherited from class com.liferay.portal.security.membershippolicy.BaseSiteMembershipPolicy |
|---|
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 DummySiteMembershipPolicy()
| Method Detail |
|---|
public void checkMembership(long[] userIds,
long[] addGroupIds,
long[] removeGroupIds)
SiteMembershipPolicyLiferay's core services call this method before adding the users to and removing the users from the respective sites. 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 sitesaddGroupIds - the primary keys of the sites to which the users are
to be added (optionally null)removeGroupIds - the primary keys of the sites from which the users
are to be removed (optionally null)
public boolean isMembershipAllowed(long userId,
long groupId)
SiteMembershipPolicytrue if the user can be added to the site. Liferay's
UI calls this method.
isMembershipAllowed in interface SiteMembershipPolicyisMembershipAllowed in class BaseSiteMembershipPolicyuserId - the primary key of the usergroupId - the primary key of the site
true if the user can be added to the site;
false otherwise
public boolean isMembershipRequired(long userId,
long groupId)
SiteMembershipPolicytrue 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 SiteMembershipPolicyisMembershipRequired in class BaseSiteMembershipPolicyuserId - the primary key of the usergroupId - the primary key of the site
true if site membership for the user is mandatory;
false otherwise
public boolean isRoleAllowed(long userId,
long groupId,
long roleId)
SiteMembershipPolicytrue if the role can be added to the user on the
site. Liferay's UI calls this method.
isRoleAllowed in interface SiteMembershipPolicyisRoleAllowed in class BaseSiteMembershipPolicyuserId - 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
public boolean isRoleRequired(long userId,
long groupId,
long roleId)
SiteMembershipPolicytrue if the role is mandatory for the user on the
site. Liferay's UI calls this method.
isRoleRequired in interface SiteMembershipPolicyisRoleRequired in class BaseSiteMembershipPolicyuserId - 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 otherwise
public void propagateMembership(long[] userIds,
long[] addGroupIds,
long[] removeGroupIds)
SiteMembershipPolicyThe actions must ensure the integrity of each site's membership policy. For example, some actions for implementations to consider performing are:
userIds - the primary key of the users that have been added or
removedaddGroupIds - the primary keys of the sites to which the users were
added (optionally null)removeGroupIds - the primary keys of the sites from which the users
were removed (optionally null)public void verifyPolicy(Group group)
SiteMembershipPolicy
verifyPolicy in interface SiteMembershipPolicyverifyPolicy in class BaseSiteMembershipPolicygroup - the site to verify
public void verifyPolicy(Group group,
Group oldGroup,
List<AssetCategory> oldAssetCategories,
List<AssetTag> oldAssetTags,
Map<String,Serializable> oldExpandoAttributes,
UnicodeProperties oldTypeSettingsProperties)
SiteMembershipPolicyThe actions must ensure the integrity of the site's membership policy based on what has changed in the site's attribute values, categories, tags, expando attributes, and type settings properties.
For example, if the membership policy is that sites 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());.
group - the added or updated site to verifyoldGroup - the old siteoldAssetCategories - the old categoriesoldAssetTags - the old tagsoldExpandoAttributes - the old expando attributesoldTypeSettingsProperties - the old type settings properties
|
Liferay 7.0-ce-b4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||