Beispiel #1
0
        public PowerShellResults EnableOrganizationCustomization()
        {
            LocalSession localSession = LocalSession.Current;

            RbacSettings.AddSessionToCache(localSession.CacheKeys[0], localSession, false, false);
            return(base.InvokeAsync(new PSCommand().AddCommand("Enable-OrganizationCustomization"), delegate(PowerShellResults results)
            {
                if (results != null && results.ErrorRecords.IsNullOrEmpty())
                {
                    LocalSession.Current.FlushCache();
                }
            }));
        }
Beispiel #2
0
        private RbacSession CreateSession()
        {
            RbacSession result;

            using (new AverageTimePerfCounter(EcpPerfCounters.AverageRbacSessionCreation, EcpPerfCounters.AverageRbacSessionCreationBase, true))
            {
                using (EcpPerformanceData.CreateRbacSession.StartRequestTimer())
                {
                    RbacContext rbacContext = new RbacContext(this);
                    RbacSession rbacSession = rbacContext.CreateSession();
                    RbacSettings.AddSessionToCache(this.CacheKey, rbacSession, true, true);
                    rbacSession.SessionStart();
                    result = rbacSession;
                }
            }
            return(result);
        }