コード例 #1
0
ファイル: SetupHelper.cs プロジェクト: LvSongping/ClearCanvas
        /// <summary>
        /// Import authority tokens defined in local plugins.
        /// </summary>
        public static void ImportAuthorityTokens(string[] addToGroups)
        {
            var tokens    = AuthorityGroupSetup.GetAuthorityTokens();
            var summaries = tokens.Select(t => new AuthorityTokenSummary(t.Token, t.DefiningAssembly, t.Description, t.FormerIdentities)).ToList();

            Platform.GetService <IAuthorityGroupAdminService>(
                service => service.ImportAuthorityTokens(new ImportAuthorityTokensRequest(summaries, new List <string>(addToGroups))));

            LogImportedTokens(tokens);
        }
コード例 #2
0
 /// <summary>
 /// Imports authority tokens from all installed plugins.
 /// </summary>
 /// <param name="context">Persistence context</param>
 /// <returns>A complete list of all existing authority tokens (including any that existed prior to this import).</returns>
 public IList <AuthorityToken> ImportFromPlugins(IUpdateContext context)
 {
     // scan all plugins for token definitions
     AuthorityTokenDefinition[] tokenDefs = AuthorityGroupSetup.GetAuthorityTokens();
     return(Import(tokenDefs, null, context));
 }