cancel
Showing results for 
Search instead for 
Did you mean: 

Change document access rights for content

ghernando
Champ in-the-making
Champ in-the-making
I would like to be able to change the access rights for a piece of content (ie., change which users can see it) via Web Services.
(I don't want to move the content to a folder to inherit the access rights of the folder.)

- How can I search for content with a specified access right?  Can I do it as part of my search with Lucene?  How?
- How can I change the access rights via Web Services?

Thanks
1 REPLY 1

openpj
Elite Collaborator
Elite Collaborator
For the first question I think you can use a Lucene query search by metadata content as cm:

String queryLucene = "PATH:\"/app:company_home/"+ALFRESCO_SPACE+"/*\" AND @cm\\:name:"+CONTENT_NAME;
Query query = new Query(Constants.QUERY_LANG_LUCENE, queryLucene);
ResultSet rs = WebServiceFactory.getRepositoryService().query(STORE, query, false).getResultSet();
etc…
You can define more metadata modifying the Alfresco Content Model (CM) and so you will search by this your metadata related to all the contents created with this new content model.

Second question: you can change the access rights via Web Services using the AccessControlService:

WebServiceFactory.getAccessControlService();
and you can see the official wiki to get more information about all the methods available:

http://wiki.alfresco.com/wiki/Access_Control_Web_Service

Hope this helps