cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with copiedFrom Aspect and Actions

hf409
Champ in-the-making
Champ in-the-making
Hi all,

i have the following structure:
- Template1 (read access for admin only)
- Template2 copied from Template1 from admin
- Folder1 copied from Template2 as user. This folder gets an action.

When I try to delete Folder1 as user I get an AccessDeniedException. This is due to
the action in Folder1. On deletion it is checked that all rules are executed, following
back all copiedFrom links. As I have no read access to Template1 the exception is thrown.

I am not sure why this check is necessary - maybe someone can give me a hint?
I don't want to give read access to Template1, so the other option seems to remove
the copiedFrom aspect. Is it save to do so, or will it break something else?

Thanks for any help,
Heike
2 REPLIES 2

wissam_aboujaou
Champ in-the-making
Champ in-the-making
Hi all,

I have the following business:
When deleting a node i must delete all its created copies if found.
What i did is create a class OnDeleteDocumentTrigger that implements BeforeDeleteNodePolicy then using the CopyService i used the function getCopies that will retrieve all the copied node UUID (Till now all is running correctly and all the nodes are retrived) then trying to delete the retrieved nodes.
The problem is that the copied nodes are not deleted neither its parent node(originator) and i am getting the following error in FireBug:
JavaException: org.springframework.dao.ConcurrencyFailureException: Deleted 0 but expected 1

Any help!!!
Thanks.
Wissam.

I had solved the problem by using the Alfesco way ActionExecutor that will execute an action to delete all the node.
what was happening as i noticed is that Alfresco is trying to delete a node and at the same time using the same process i am trying to delete other nodes and that created a dead lock.