/// <summary> /// Is this user a member of given role. /// </summary> /// <param name="role">Role to check.</param> /// <returns>Is this user a member of given role.</returns> public bool IsInRole(Role role) { if (role == null) throw new ArgumentNullException("role"); if (!ID.HasValue) return false; return role.IsInRole(ID.Value); }
/// <summary> /// Returns role from role details. /// </summary> /// <param name="details">Role details.</param> /// <returns>Role.</returns> public static Role GetRoleFromDetails( RoleDetails details ) { Role role = new Role(); role.m_ID = details.ID; role.m_RoleID = details.RoleID; role.m_Name = new MLText(); role.m_Name.LoadFromXML( details.Name ); role.m_Description = new MLText(); role.m_Description.LoadFromXML( details.Description ); return role; }