Hi All,
I want to create webscript such that when it is executed then only permissions on file/folder are given to Custom roles which are created.
I have gone through basic documentation of Webscript as i hadnt work on it before but didnt got much help on how to proceed furthur with my task. If any one could help out how should i move on creating this type of webscipt which on execution gives permission to custom roles on files/folders.
Thanks,
Piyush.
If i understood correctly, there is no way you can apply the permission on the webscripts invocation. You can however authenticate the webscript via "user" authentication and write your custom logic to check permissions within the webscript.
See here for more details on webscript authentication: https://docs.alfresco.com/6.1/concepts/ws-authenticating.html
Have a look at this post where you can see a download webscript which checks for permissions (look for isNotAuthorised method call): https://hub.alfresco.com/t5/alfresco-content-services-blog/downloading-content-from-alfresco-reposit...
http://javaworld-abhinav.blogspot.com/2017/08/downloading-content-from-alfresco.html
You can take a reference and write your webscript to check permissions and perform required operation.
Hello,
You have to create a basic web script first to be sure that it works fine and place under alfresco.
You can follow the official documentation
If the basic web script works fine, then u can implement your custom code to set permissions using PermissionService:
For more help how to set permissions have a look on this and this.
Best regards.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.