public bool IsUserInRole(UmsRoles roleName) { Guid?currentUserId = this.GetCurrentUserId(); bool flag = false; if (currentUserId.HasValue && currentUserId.Value != Guid.Empty) { flag = this.IsUserInRole(currentUserId.Value, roleName); } return(flag); }
public bool IsUserInRole(Guid userId, UmsRoles roleName) { UmsRoles umsRole; if (SessionManager.GetCurrentUserData <UmsRoles>(userId, SessionKeys.CurrentUserRole, out umsRole)) { return(roleName.Equals(umsRole)); } bool flag = this._client.IsUserInRole(userId, roleName); if (flag) { SessionManager.PutCurrentUserData <UmsRoles>(userId, SessionKeys.CurrentUserRole, roleName); } return(flag); }