コード例 #1
0
ファイル: Person.cs プロジェクト: Confirmit/Portal
        /// <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);
        }
コード例 #2
0
ファイル: Role.cs プロジェクト: Confirmit/Portal
        /// <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;
        }