This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Property to prevent deletion of document

Hi

I'm looking for a way to prevent users from deleting a document, based on a value in a property (text field). Does anyone know, which property I have to change to read only (with metadata card configuration rules) that sets the document undeletable? I should still be possible to change the text field (e.g. to delete the value) and set the document deletable again. But as long as there is a text in the text field, no one should be able to delete it.

Thanks for any help and ideas!

Best regards

Christian

Parents
  • A text property cannot be used directly here as only value list properties can affect object permissions. So I would add a new property definition of type "Choose from list", for instance property "Can delete?" with two values "Yes" and "No" (create also a new value list for this).

    Then for the "No" value list item you can set automatic permissions to deny the delete operation for all users. Note that admin users are not restricted by any permission settings so they would still be able to delete the document.

    I haven't tested this but the configuration would probably look something like below. Make sure that you try it first in some non-production environment.

    Value list settings:

    In the property definition settings you need to enable automatic permissions via the property:

    If it absolutely needs to be based on the text property, then I would still add the value list property like described above to set the permissions and see if you could automatically set the value list property to "No" when some text is entered in the text field. Compliance Kit's Managed Properties module might be one option to do this, although that would only set the value when the changes are saved to the server (not dynamically on the metadata card as the user starts typing into the text field - not sure if this is a problem in your case or not).

Reply
  • A text property cannot be used directly here as only value list properties can affect object permissions. So I would add a new property definition of type "Choose from list", for instance property "Can delete?" with two values "Yes" and "No" (create also a new value list for this).

    Then for the "No" value list item you can set automatic permissions to deny the delete operation for all users. Note that admin users are not restricted by any permission settings so they would still be able to delete the document.

    I haven't tested this but the configuration would probably look something like below. Make sure that you try it first in some non-production environment.

    Value list settings:

    In the property definition settings you need to enable automatic permissions via the property:

    If it absolutely needs to be based on the text property, then I would still add the value list property like described above to set the permissions and see if you could automatically set the value list property to "No" when some text is entered in the text field. Compliance Kit's Managed Properties module might be one option to do this, although that would only set the value when the changes are saved to the server (not dynamically on the metadata card as the user starts typing into the text field - not sure if this is a problem in your case or not).

Children
No Data