1

There is a SharePoint User group called A and there is a document library called Doc. The group A has permissions to add, delete, view items present in Doc. When a user of group A views a page with Doc Library view, based on some conditions(I am checking this condition in Javascript) he may or may not be able to add/delete the items in Doc. Meaning if condition is satisfied he should not be able to Add/Delete otherwise he should be able to. This is the view:

enter image description here

I can disable the "Add New Template" link for adding but what can I do for disabling the Delete which can be done using the Delete button? Also is it possible to toggle between permissions of Read and Contribute based on condition in javascript? Please note that the user of Group A cannot go to the library view and add/delete. Only this page is visible to them.

  • You do know that if a user just creates a new personal view they can bypass all your measures? You're not altering permissions, you're just hiding buttons. Not to mention savvy users can revert your customizations in the F12 tools. – Derek Gusoff Sep 18 '17 at 13:59
  • This user does not have permissions to navigate anywhere in the site except the site pages we expose to him. So he would not be able to create a View. Anyhow the link Add New Template is provided by us so we can add remove it. – zainul Sep 19 '17 at 12:02
  • I just want to toggle between the two permission levels i.e. Read and Contribute basically. – zainul Sep 19 '17 at 12:04
0

Regarding restricting the 'Delete Items' permission, you might be able to manage this through creating a custom permission and then granting the permission to a new User Group. I am using SP 2013 on-premises.

In the Site Collection menu go to Site Permissions/Permission Levels - here you will find the standard Sharepoint user groups. I would not recommend modifying any of these - to do so is not best practise and could cause a lot of trouble.

  1. Create a custom Permission - If you look at the OOTB standard 'Contribute' group for comparison, copy these permissions for your new custom permission, except do not select the 'Delete Items' list permissions.

  2. Create a new Group + grant the new custom permission to the group.

    • Create Group, call the new group something like 'Contribute_no delete'.
    • You will see your new Permission listed under the heading 'Give Group Permission to this Site', tick the box next to the new permission.

You will need to ensure that the new group has access to the list you are working on - check via the document library/list settings.

  • But then the user will never be able to delete anything from the library. But my requirement is to be able to toggle between the two based on some conditions. – zainul Sep 18 '17 at 12:26
  • That's true, I overlooked that. My solution would not help in that case. – Tally Sep 18 '17 at 12:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.