IsUserInRole() public static method

public static IsUserInRole ( string groupName ) : bool
groupName string
return bool
Example #1
0
 public bool RemoveFromRole(string roleName)
 {
     if (SecurityData.IsUserInRole(this.UserName, roleName))
     {
         SecurityData.RemoveUserFromRole(this.UserName, roleName);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Example #2
0
 public bool AddToRole(string roleName)
 {
     if (!SecurityData.IsUserInRole(this.UserName, roleName))
     {
         SecurityData.AddUserToRole(this.UserName, roleName);
         return(true);
     }
     else
     {
         return(false);
     }
 }