public AllowRole AddRole(string roleName) { var allow = new AllowRole(roleName); _policies.AddValue(allow); return allow; }
/// <summary> /// Adds an authorization rule based on membership in a given role /// on the principal /// </summary> /// <param name="roleName"></param> /// <returns></returns> public AllowRole AddRole(string roleName) { if (AllowedRoles().Contains(roleName)) { return(null); } var allow = new AllowRole(roleName); _policies.Add(allow); return(allow); }