Permissions configuration

The security configuration information is stored in the SecurityConfig class.

The configuration information for the permission sets is persisted in the Permissions property of the SecurityConfig class. The code below gets the configuration information for a permission set. The Telerik.Sitefinity.Security.SecurityConstants.Sets class contains the names of all permission sets. 

In the following example, first, you initialize the SecurityConfig class. The Permissions property is a dictionary that accepts the permission set name as key. To get the blogs permission set, you use BlogsPermissions.Sets.Blog.SetNameas key.

The permission sets that the Permissions property stores contain all configuration information about the actions that can be granted or denied for the given set of objects. In the following example, blogsPermissions contains all actions that can be performed on blogs. You use the actions when creating permission associated with a permission set and granting and denying it for the principal. For more information, see For developers: Grant and deny permissions.

The following example initializes the view action for the blogs:

The Actions property of the Permission class is a dictionary that accepts the action name as key. To get the view action for the blog, you use BlogsPermissions.Sets.Blog.SetNameas key.

An action in Sitefinity CMS is characterized with a set of properties.

  • Name
    The name of the action.
  • Title
    The title of the action.
  • Description
    The description of the action.
  • Value
    The value of the action. The actions in the permission set have specific order (starting from 0) that defines their value using the equation action value = 2ordinal. When creating permission, you use the Value property to create the proper bit mask to grant or deny the action. For more information, see For developers: Permissions API and For developers: Grant and deny permissions.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?