More in this section
Forums / Developing with Sitefinity / Remove the "Everyone" view permission for a news item

Remove the "Everyone" view permission for a news item

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
1 posts, 0 answered
  1. James
    James avatar
    0 posts
    15 Sep 2016
    18 Nov 2016
    Link to this post

    I'm creating a news item through the api and in the same process assign view permission only to certain roles. 

    I've managed to break the inheritance and assign the correct view permission but I'm unable to remove the permission for "Everyone" through the api...

    It seems that if I use:

    var everyonePermission = newsManager.GetPermission(SecurityConstants.Sets.General.SetName, newsItem.Id,

    It returns null. So if I then create the permission for everyone and ungrant access to view the item it throws and exception saying that it can't create a duplicate key in the sf_permissions index which means that this permission must already exist.

    I've tried this at various points in the lifecycle of creating the news item, before and after publishing it, using the master item. All to no avail.

    So my question is: how do you possibly remove the Everyone view permission?

1 posts, 0 answered