/// <summary> /// Import authority groups defined in local plugins. /// </summary> public static void ImportAuthorityGroups() { var groups = AuthorityGroupSetup.GetDefaultAuthorityGroups(); var groupDetails = groups.Select(g => new AuthorityGroupDetail( null, g.Name, g.Description, g.DataGroup, g.Tokens.Select(t => new AuthorityTokenSummary(t)).ToList() )).ToList(); Platform.GetService <IAuthorityGroupAdminService>( service => service.ImportAuthorityGroups(new ImportAuthorityGroupsRequest(groupDetails))); LogImportedDefaultGroups(groups); }
/// <summary> /// Import authority groups from extensions of <see cref="DefineAuthorityGroupsExtensionPoint"/>. /// </summary> /// <remarks> /// Creates any authority groups that do not already exist. /// This method performs an additive import. It will never remove an existing authority group or /// remove authority tokens from an existing group. /// </remarks> /// <param name="context"></param> public IList <AuthorityGroup> ImportFromPlugins(IUpdateContext context) { AuthorityGroupDefinition[] groupDefs = AuthorityGroupSetup.GetDefaultAuthorityGroups(); return(Import(groupDefs, context)); }
/// <summary> /// Import authority groups defined in local plugins. /// </summary> public static void ImportEmbeddedAuthorityGroups() { var groups = AuthorityGroupSetup.GetDefaultAuthorityGroups(); ImportAuthorityGroups(groups, "plugins"); }