示例#1
0
        public void AddRole(RoleNode role)
        {
            if (!Roles.Any(r => r.Id.Equals(role.Id)))
            {
                var clone = role.DeepClone();
                clone.ParentType = ParentType.RoleNode;
                clone.ParentId   = Id;

                Roles.Add(clone);

                if (!Role.Roles.Any(r => r.Id.Equals(role.Id)))
                {
                    Role.Roles.Add(clone.Role);
                }
            }
        }
示例#2
0
        public void AddRole(RoleNode role)
        {
            if (!Roles.Any(r => r.Id.Equals(role.Id)))
            {
                var clone = role.DeepClone();
                clone.ParentId   = Id;
                clone.ParentType = ParentType.UserNode;

                Roles.Add(clone);

                if (!UserAuthorisation.Roles.Any(r => r.Id.Equals(role.Id)))
                {
                    UserAuthorisation.Roles.Add(clone.Role);
                }
            }
        }
        public void AddRole(RoleNode role)
        {
            if (!Roles.Any(r => r.Id.Equals(role.Id)))
            {
                var clone = role.DeepClone();
                clone.ParentId = Id;
                clone.ParentType = ParentType.UserNode;

                Roles.Add(clone);

                if (!UserAuthorisation.Roles.Any(r => r.Id.Equals(role.Id)))
                {
                    UserAuthorisation.Roles.Add(clone.Role);
                }
            }
        }
        public void AddRole(RoleNode role)
        {
            if (!Roles.Any(r => r.Id.Equals(role.Id)))
            {
                var clone = role.DeepClone();
                clone.ParentType = ParentType.RoleNode;
                clone.ParentId = Id;

                Roles.Add(clone);

                if (!Role.Roles.Any(r => r.Id.Equals(role.Id)))
                {
                    Role.Roles.Add(clone.Role);
                }
            }
        }