Example #1
0
 /// <summary>
 /// Adiciona os usuário informados para os papéis informados.
 /// </summary>
 /// <param name="usernames"></param>
 /// <param name="roleNames"></param>
 public static void AddUsersToRoles(string[] usernames, string[] roleNames)
 {
     Initialize();
     SecurityUtility.CheckArrayParameter(ref roleNames, true, true, true, 0, "roleName");
     SecurityUtility.CheckArrayParameter(ref usernames, true, true, true, 0, "usernames");
     Provider.AddUsersToRoles(usernames, roleNames);
 }
Example #2
0
 /// <summary>
 /// Recupera todos os papéis associados com o usuário.
 /// </summary>
 /// <param name="username"></param>
 /// <returns></returns>
 public static string[] GetRolesForUser(string username)
 {
     Initialize();
     SecurityUtility.CheckParameter(ref username, true, false, true, 0, "username");
     if (username.Length < 1)
     {
         return(new string[0]);
     }
     return(Provider.GetRolesForUser(username));
 }
Example #3
0
 /// <summary>
 /// Apaga o papel do sistema.
 /// </summary>
 /// <param name="roleName"></param>
 /// <returns></returns>
 public static bool DeleteRole(string roleName)
 {
     Initialize();
     SecurityUtility.CheckParameter(ref roleName, true, true, true, 0, "roleName");
     return(Provider.DeleteRole(roleName));
 }