IsUserInRole() public static method

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