cancel
Showing results for 
Search instead for 
Did you mean: 

disable delete by permission

jbrowne
Champ in-the-making
Champ in-the-making
I want it so that anyone can upload content, and even edit the metadata, etc.
But no one except admin can delete across my entire install/all sites.

I was thinking maybe editing config files - but not sure which ones.  Or doing a trigger on the database upon upload of new content.

can someone give me a point in the right direction please?
5 REPLIES 5

parzgnat
Star Contributor
Star Contributor
Assuming that you're using Alfresco Share as your interface, the easiest way to accomplish what you're trying to do is to just disable the delete action in Share.  The drawback of this option is that you're not actually changing permissions on the document to disable delete, so if you came in with any interface other than Share, users would be able to delete.  Here are the steps for disabling the Delete and Multi-Delete actions.  Note that for brevity the changes that I'm outlining involve modifying the core Alfresco Share config files rather than extending the core config through your own custom config files.  For creating more portable customization, you should do a Share config extension, rather than modifying the core config.  There are plenty of tutorials out there for how to "properly" extend Share, but here is the quick and dirty way:

In the share-documentlibrary-config.xml file located at $ALFRESCO_HOME/tomcat/share/WEB-INF/classes/alfresco, make the following changes:

Comment out the XML node that looks like this:
<action id="document-delete" … >

Additionally, for any
<actionGroup>
nodes found toward the end of the file, comment out the delete action.


In the toolbar.get.config.xml file located at $ALFRESCO_HOME/tomcat/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/documentLibrary, make the following change:

Comment out the XML node that looks like this:
<action type="action-link" id="onActionDelete" … />


Hope this helps.

jbrowne
Champ in-the-making
Champ in-the-making
I removed the delete items from share-documentlibrary-config.xml
and I restarted my server that Alfresco is hosted on.
after the restart, no one, not even admin can delete (or has a delete button).

btw, the file  toolbar.get.config.xml didn't contain any actions - it only had one entry and it was nothing like delete, so I did not edit this file.

thanks for the help.

haha - removing the delete control is very funny 😉
You allready mentioned the right direction: You need to put the users in the right group which has set the expected right on the space hierarchie.
Go to Repository, navigate to your folder and change or add access rights:
http://docs.alfresco.com/community/topic/com.alfresco.community.doc/concepts/cuh-user-roles-permissi...

You should understand that Owner have allways all rights on self created files. If you don't want this you need to code to change ownership.

jbrowne
Champ in-the-making
Champ in-the-making
don't want to change ownership though, because I want to know who put the file there.
this is used for an archive - that's why I do not want anyone deleting things.

sandeepreddy1
Star Contributor
Star Contributor
Hai jbrowne,

How to Disable delete permision for alfresco users not for admin people. is there any solution help me please