Skip to content

Instantly share code, notes, and snippets.

@sitefinitySDK
Created November 14, 2013 12:11
SF_10.1, SF_10.2, SF_11.0, SF_11.1, SF_11.2, SF_12.0, SF_12.1, SF_12.2, SF_13.0, SF_13.1, SF_13.2, SF_13.3, SF_14.0, SF_14.1, SF_14.2, SF_14.3 - https://docs.sitefinity.com/for-developers-roles
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Telerik.Sitefinity.Security;
using Telerik.Sitefinity.Security.Model;
namespace Telerik.Sitefinity.Documentation.CodeSnippets.DeepDive.Security.Roles.ManagingRoles
{
public partial class RolesApiSnippets
{
public Role GetRoleByName(string roleName)
{
RoleManager roleManager = RoleManager.GetManager();
return roleManager.GetRoles().Where(r => r.Name == roleName).SingleOrDefault();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment