setInheritParentPermissions not applied
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2015 07:49 AM
Hi,
I'm working on a java code which create a new PDF and modify permissions of it.
I try to set the inherit permissions to false but it's not applied. The PDF still have inheritance at the end of the execution.
I try to use RetryingTransactionCallback to commit the PDF when it's created, but it doesn't change anything.
Also, I use "AuthenticationUtil.runAsSystem" to execute the code.
I work on Alfresco 4.0.2 Enterprise.
Do you have some ideas to fix this issue ?
Thanks !
Regards
I'm working on a java code which create a new PDF and modify permissions of it.
I try to set the inherit permissions to false but it's not applied. The PDF still have inheritance at the end of the execution.
private void droitsDuPDF() { PermissionService permissionService = getServiceRegistry().getPermissionService(); // Suppression des droits sur le fichier permissionService.deletePermissions(nodePDF); permissionService.setInheritParentPermissions(nodePDF, false); // Récupération du répertoire parent ChildAssociationRef caRepertoire = nodeService.getPrimaryParent(nodeOrigine); NodeRef repertoire = caRepertoire.getParentRef(); // Récupération des groupes ayant des droits sur l'espace Set<AccessPermission> droitsRepertoire = permissionService.getAllSetPermissions(repertoire); // Ajout des droits en lecture sur le PDF, pour chaque groupe récupéré du répertoire for (AccessPermission permission : droitsRepertoire) { permissionService.setPermission(nodePDF,permission.getAuthority(),PermissionService.CONSUMER, true); }}
I try to use RetryingTransactionCallback to commit the PDF when it's created, but it doesn't change anything.
private NodeRef convertToPdf() throws Exception { RetryingTransactionCallback<Object> txnWork = new RetryingTransactionCallback<Object>() { @Override public Object execute() throws Exception { //mon traitement } }; TransactionService transactionService = getServiceRegistry().getTransactionService(); NodeRef child = (NodeRef) transactionService.getRetryingTransactionHelper().doInTransaction(txnWork, true); return child; }
Also, I use "AuthenticationUtil.runAsSystem" to execute the code.
I work on Alfresco 4.0.2 Enterprise.
Do you have some ideas to fix this issue ?
Thanks !
Regards
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2015 04:54 AM
Hi !
I still haven't found a solution yet.
If you have an idea, do not hesitate !
Regards
I still haven't found a solution yet.
If you have an idea, do not hesitate !
Regards
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2015 05:31 AM
You are running an update in a read only transaction!
I'd expect an exception to be thrown.
I'd expect an exception to be thrown.
