Ejemplo n.º 1
0
        public virtual async Task Ensure(ApplicationManagerClient appMgr, IdentityManagerClient idMgr, string entApiKey, string username)
        {
            // check in to see if user has free trial/paid subscriber rights
            var authResp = await idMgr.HasAccess(entApiKey, username, new List <string>() { "LCU.NapkinIDE.AllAccess" });

            State.IsActiveSubscriber = authResp.Status;

            var activitiesResp = await appMgr.LoadIDEActivities(entApiKey);

            if (State.IsActiveSubscriber)
            {
                var appsResp = await appMgr.ListApplications(entApiKey);

                State.InfrastructureConfigured = activitiesResp.Status && !activitiesResp.Model.IsNullOrEmpty() && appsResp.Status && !appsResp.Model.IsNullOrEmpty();
            }
            else
            {
                State.InfrastructureConfigured = true;
            }

            if (activitiesResp.Status)
            {
                await SetupActivities(activitiesResp.Model, entApiKey);
            }

            await LoadHeaderActions();

            await LoadSideBar(appMgr, entApiKey);

            if (State.IsActiveSubscriber)
            {
                var appsResp = await appMgr.ListApplications(entApiKey);

                State.InfrastructureConfigured = activitiesResp.Status && !activitiesResp.Model.IsNullOrEmpty() && appsResp.Status && !appsResp.Model.IsNullOrEmpty();
            }
            else
            {
            }
        }
Ejemplo n.º 2
0
        public virtual async Task SetToursEnabled(IdentityManagerClient idMgr, string entApiKey, string username)
        {
            var authResp = await idMgr.HasAccess(entApiKey, username, new List <string>() { "LCU.NapkinIDE.AllAccess" });

            State.ToursEnabled = !authResp.Status;
        }