void AddPermissionTrees(XElement application)
        {
            var assemblyAttrs =
                Assemblies.SelectMany(path => PermissionTreeAttribute.FromCustomAttributeProvider(Resolver.GetAssembly(path)));

            // Add unique permissionGroups to the manifest
            foreach (var pta in assemblyAttrs.Distinct(new PermissionTreeAttribute.PermissionTreeAttributeComparer()))
            {
                if (!application.Parent.Descendants("permissionTree").Any(x => (string)x.Attribute(attName) == pta.Name))
                {
                    application.AddBeforeSelf(pta.ToElement(PackageName));
                }
            }
        }
Example #2
0
        void AddPermissionTrees(XElement application, List <string> selectedWhitelistAssemblies)
        {
            // Look in user assemblies + whitelist (like Maps)
            var check_assemblies = Assemblies.Union(selectedWhitelistAssemblies);

            var assemblyAttrs =
                check_assemblies.SelectMany(path => PermissionTreeAttribute.FromCustomAttributeProvider(Resolver.GetAssembly(path)));

            // Add unique permissionGroups to the manifest
            foreach (var pta in assemblyAttrs.Distinct(new PermissionTreeAttribute.PermissionTreeAttributeComparer()))
            {
                if (!application.Parent.Descendants("permissionTree").Any(x => (string)x.Attribute(attName) == pta.Name))
                {
                    application.AddBeforeSelf(pta.ToElement(PackageName));
                }
            }
        }