Can we allow users to rename files but prevent them from deleting those files inside SharePoint online

john john 906 Reputation points
2023-07-19T23:01:42.36+00:00

We created a custom permission level which mimic the built-in Contribute permission level but without the ability to delete items and versions, but unchecking those 2 checkboxes:-

User's image

our intention was to prevent users from moving folders and deleting folders, but currently users can not rename files.. so what are the approaches we have to allow users to rename files but not to delete them?

second point, is developing a remote event receiver the only way to achieve this?

Thanks

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,122 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,544 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Zehui Yao_MSFT 5,801 Reputation points
    2023-07-20T05:31:35.1933333+00:00

    Hi john john,

    I tested it locally and be able to reproduce the same issue. Per our research, this is by design.

    If you uncheck the delete item permission, the rename option will also be removed from the [...] menu.

    If modify the file name through the properties option, a prompt for insufficient permissions is also displayed.

    For the second point, please provide more details about remote event receiver. This way we can do more in-depth troubleshooting.

    image (25)

    image (26)

    image (27)

    image (28)


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.