mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged BRANCHES/DEV/V4.1-BUG-FIX to HEAD
43795: Fix for ALF-16254 - "Leave Site" behaviour for group based site membership: The API - "api/sites/<siteid>/memberships/<authority>" now returns additional json boolean value "isMemberOfGroup" to indicate if the specified user has an implied group membership of a site or a direct membership. This is the same information that is also returned by the full site membership "api/sites/<siteid>/memberships" API - so makes them more consistent also. Share now takes the additional value into account when making the decision on whether to render the "Leave Site" button on the site title component. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@43801 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -48,6 +48,7 @@ import org.alfresco.service.cmr.security.AccessStatus;
|
||||
import org.alfresco.service.cmr.security.PermissionService;
|
||||
import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.alfresco.service.cmr.site.SiteInfo;
|
||||
import org.alfresco.service.cmr.site.SiteMemberInfo;
|
||||
import org.alfresco.service.cmr.site.SiteService;
|
||||
import org.alfresco.service.cmr.site.SiteVisibility;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
@@ -361,7 +362,7 @@ public class Site implements Serializable
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a user's role on this site.
|
||||
* Gets a user's role in this site.
|
||||
* <p>
|
||||
* If the user is not a member of the site then null is returned.
|
||||
*
|
||||
@@ -373,6 +374,19 @@ public class Site implements Serializable
|
||||
return this.siteService.getMembersRole(getShortName(), authorityName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets extended information on the user's role in this site.
|
||||
* <p>
|
||||
* If the user is not a member of the site then null is returned.
|
||||
*
|
||||
* @param authorityName authority name
|
||||
* @return SiteMemberInfo user's role information or null if not a member
|
||||
*/
|
||||
public SiteMemberInfo getMembersRoleInfo(String authorityName)
|
||||
{
|
||||
return this.siteService.getMembersRoleInfo(getShortName(), authorityName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether a user is a member of the site.
|
||||
*
|
||||
|
Reference in New Issue
Block a user