05-25-2020 01:38 AM
Hello All,
I want to get all roles whether it is custom or OOTB present under the Users site for using it.
Since i have seen only a way to get role of a current user only. So whether it is possible to get all the roles from the site??
Thanks.
05-25-2020 02:26 AM
Hi,
I think this piece of code may help you out for your requirement:-
public ScriptableHashMap<String, String> getSitePermissionGroups() { if (this.siteRoleGroups == null) { List<String> roles = this.siteService.getSiteRoles( this.siteInfo.getShortName() ); this.siteRoleGroups = new ScriptableHashMap<String, String>(); for (String role : roles) { this.siteRoleGroups.put( role, this.siteService.getSiteRoleGroup(this.siteInfo.getShortName(), role)); } } return this.siteRoleGroups; }
See you will get Groups associated with all the roles present in your site.
Please apply and get back to me.
Thanks,
Piyush Patel
05-25-2020 02:51 AM
Hi,
Could you provide me the whole approach or code which i should add to the piece of code you provided to me.
Or please someone can you please help me out by providing whole steps to follow or where should i add this code on my SDK. Since i am new to Alfresco any help regarding this will be very helpful.
Thanks.
05-26-2020 09:21 AM
Hi all,
Please someone could guide me through it though @piyush48 tried to help me but could someone please provide code and path where i should place it.
I am new in alfresco and have urgent requirement for this.
Thanks,
Piyush
Explore our Alfresco products with the links below. Use labels to filter content by product module.