06-01-2020 08:25 AM
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.
06-01-2020 09:32 AM
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.
06-03-2020 06:32 PM
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.
Explore our Alfresco products with the links below. Use labels to filter content by product module.