When anonymous access is enabled on 'Entire Site' the SharePoint opens the anonymous access to all the lists which inherit the permissions from the parent. Even if you try to create the new list programmatically or via interface, it can be seen by the anonymous users and if the list stores the sensitive data then it becomes the big worry for you.
Here's the way how you can disable anonymous access programmatically:
SPList list = // fetch the desired list;
list.BreakRoleInheritance(false);
// this disables the interface options for anonymous access under permissions settings for the list
list.AnonymousPermMask64 = SPBasePermissions.EmptyMask;
To disable the access via UI follow these steps
- List(desired list) > List Settings > Permissions for this list > Actions > Edit Permissions
- Un-check - In the Permissions > Settings > Anonymous Access > View Items
Hope this will help !
Majid
No comments:
Post a Comment