Esempio n. 1
0
        public ProfileOrganizationResponseModel(OrganizationUserOrganizationDetails organization) : this("profileOrganization")
        {
            Id                            = organization.OrganizationId.ToString();
            Name                          = organization.Name;
            UsePolicies                   = organization.UsePolicies;
            UseSso                        = organization.UseSso;
            UseKeyConnector               = organization.UseKeyConnector;
            UseScim                       = organization.UseScim;
            UseGroups                     = organization.UseGroups;
            UseDirectory                  = organization.UseDirectory;
            UseEvents                     = organization.UseEvents;
            UseTotp                       = organization.UseTotp;
            Use2fa                        = organization.Use2fa;
            UseApi                        = organization.UseApi;
            UseResetPassword              = organization.UseResetPassword;
            UsersGetPremium               = organization.UsersGetPremium;
            SelfHost                      = organization.SelfHost;
            Seats                         = organization.Seats;
            MaxCollections                = organization.MaxCollections;
            MaxStorageGb                  = organization.MaxStorageGb;
            Key                           = organization.Key;
            HasPublicAndPrivateKeys       = organization.PublicKey != null && organization.PrivateKey != null;
            Status                        = organization.Status;
            Type                          = organization.Type;
            Enabled                       = organization.Enabled;
            SsoBound                      = !string.IsNullOrWhiteSpace(organization.SsoExternalId);
            Identifier                    = organization.Identifier;
            Permissions                   = CoreHelpers.LoadClassFromJsonData <Permissions>(organization.Permissions);
            ResetPasswordEnrolled         = organization.ResetPasswordKey != null;
            UserId                        = organization.UserId?.ToString();
            ProviderId                    = organization.ProviderId?.ToString();
            ProviderName                  = organization.ProviderName;
            FamilySponsorshipFriendlyName = organization.FamilySponsorshipFriendlyName;
            FamilySponsorshipAvailable    = FamilySponsorshipFriendlyName == null &&
                                            StaticStore.GetSponsoredPlan(PlanSponsorshipType.FamiliesForEnterprise)
                                            .UsersCanSponsor(organization);
            PlanProductType = StaticStore.GetPlan(organization.PlanType).Product;
            FamilySponsorshipLastSyncDate = organization.FamilySponsorshipLastSyncDate;
            FamilySponsorshipToDelete     = organization.FamilySponsorshipToDelete;
            FamilySponsorshipValidUntil   = organization.FamilySponsorshipValidUntil;

            if (organization.SsoConfig != null)
            {
                var ssoConfigData = SsoConfigurationData.Deserialize(organization.SsoConfig);
                KeyConnectorEnabled = ssoConfigData.KeyConnectorEnabled && !string.IsNullOrEmpty(ssoConfigData.KeyConnectorUrl);
                KeyConnectorUrl     = ssoConfigData.KeyConnectorUrl;
            }
        }
Esempio n. 2
0
 public SsoConfigurationData GetData()
 {
     return(SsoConfigurationData.Deserialize(Data));
 }