Example #1
0
        public override RoleDefinition GetRoleDefinition(string uniqueName)
        {
            XmlRoleDefinition r = new XmlRoleDefinition();

            r.Load(uniqueName);

            return(new RoleDefinition(r));
        }
Example #2
0
        public override IEnumerator <RoleDefinition> GetRoleDefinitions(IEnumerable <string> uniqueNames, Application application)
        {
            foreach (var item in FindElements(uniqueNames))
            {
                XmlRoleDefinition r = new XmlRoleDefinition();
                r.Load(item);

                yield return(new RoleDefinition(r, application));
            }
        }
Example #3
0
        protected override void LoadInternal(XmlElement element)
        {
            base.LoadInternal(element);
            ApplicationVersion = GetAttribute(element, APPLICATIONVERSION);

            Groups          = new Collections.ApplicationGroupCollection(XmlApplicationGroup.GetChildren(element), false);
            Operations      = new Collections.OperationCollection(XmlOperation.GetChildren(element), false);
            Tasks           = new Collections.TaskCollection(XmlTask.GetTasks(element), false);
            Roles           = new Collections.RoleDefinitionCollection(XmlRoleDefinition.GetRoles(element), false);
            RoleAssignments = new Collections.RoleAssignmentsCollection(XmlRoleAssignments.GetChildren(element));
        }
Example #4
0
        public RoleDefinition CreateRole(string parent, string name, string description)
        {
            XmlRoleDefinition d = new XmlRoleDefinition();

            d.Key         = System.Guid.NewGuid().ToString();
            d.Name        = name;
            d.Description = description;

            d.Operations = new Collections.OperationCollection(true);
            d.Tasks      = new Collections.TaskCollection(true);
            d.Roles      = new Collections.RoleDefinitionCollection(true);

            _Service.Save(d.ToXml(_Service.Load(parent)));

            return(new RoleDefinition(d));
        }