cancel
Showing results for 
Search instead for 
Did you mean: 

Dashlet Permissions

jainkumar11
Champ in-the-making
Champ in-the-making
Hi All,

Greetings!!!!!
I have a custom dashlet which I want to be available only to specific set of users.
And to all other users this dashlet should not be displayed.

Can something of this sort be done in Alfresco.
If yes please provide some pointers.

Thanks
KJ
2 REPLIES 2

afaust
Legendary Innovator
Legendary Innovator
Hello,

this is totally possible, but the approach to take depends on how you determine the "permission". A simple approach would be group membership based permission, e.g. retrieve the list of groups for the current user and check if a specific group is among them. A very different thing is checking for a permission applied on a specific node - here you would have to retrieve the node info and permissions granted to the current user on that node. Both approaches require your web script controller to make a remote call to a repository web script to retrieve the necessary data. More complex requirements may force you to adapt or implement a web script in the repository to suit your needs…

Regards
Axel

angello0571
Champ on-the-rise
Champ on-the-rise
Hi,

Maybe this can help you to give you an idea, because I had to do something similar, for checking if a user is member from a particular site. If the user is not member of a site, then you do not give the content:
String site = req.getParameter("site");
      String userName = req.getParameter("userName");
      String jsonRes = new String();
      
      //Verify if the user is registered in the site.
      boolean isMember = siteService.isMember(site, userName);
               if(isMember){
         //TODO something…
      }
      else{
         //TODO something…
      }

That code is implemented with java, but the services are also available with JSON. All depends how you are programming your webscript.

As you can see I used the siteService, so I guess you have to look for the service you need Smiley Happy

I hope this can help you.

Regards!