I have Created a External web application using Servlets which is connected to alfresco repository.
I am also able to upload document in to the repository, download document from repository.
now my requirement is, i have to delete document based on user role. means i want to give delete document access to only site manager.
Please provide sample code if you have.
Thanks in Advance
In order to delete a document you first need to see if the user have the role to delete this is why the answer will be split in two part
Part 1 : search for authority
in this part you will see if the user have the authority to delete
Part 2 : delete method
for a document it is simple to delete it
Note that it's different for a folder , but only the part 2 will be changed ( because when you delete a folder you need to delete his child's)
to complete this answer you only need to combine part 1 with part 2.