class Comet::AdminUserPermissions

AdminUserPermissions is a typed class wrapper around the underlying Comet Server API data structure.

def clear

def clear
  @allowed_providers_when_restricted = []
  @allowed_user_policies = []
  @unknown_json_fields = {}
end

def from_hash(obj)

Parameters:
  • obj (Hash) -- The complete object as a Ruby hash
def from_hash(obj)
  raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
  obj.each do |k, v|
    case k
    when 'PreventEditServerSettings'
      @prevent_edit_server_settings = v
    when 'PreventServerShutdown'
      @prevent_server_shutdown = v
    when 'PreventChangePassword'
      @prevent_change_password = v
    when 'AllowEditBranding'
      @allow_edit_branding = v
    when 'AllowEditEmailOptions'
      @allow_edit_email_options = v
    when 'AllowEditRemoteStorage'
      @allow_edit_remote_storage = v
    when 'AllowEditWebhooks'
      @allow_edit_webhooks = v
    when 'AllowEditExternalAuthSources'
      @allow_edit_external_auth_sources = v
    when 'DenyConstellationRole'
      @deny_constellation_role = v
    when 'DenyViewServerHistory'
      @deny_view_server_history = v
    when 'DenyViewServerInfo'
      @deny_view_server_info = v
    when 'PreventRequestStorageVault'
      @prevent_request_storage_vault = v
    when 'PreventAddCustomStorageVault'
      @prevent_add_custom_storage_vault = v
    when 'HideCloudStorageBranding'
      @hide_cloud_storage_branding = v
    when 'ShouldRestrictProviderList'
      @should_restrict_provider_list = v
    when 'AllowedProvidersWhenRestricted'
      if v.nil?
        @allowed_providers_when_restricted = []
      else
        @allowed_providers_when_restricted = Array.new(v.length)
        v.each_with_index do |v1, i1|
          raise TypeError, "'v1' expected Numeric, got #{v1.class}" unless v1.is_a? Numeric
          @allowed_providers_when_restricted[i1] = v1
        end
      end
    when 'AllowedUserPolicies'
      if v.nil?
        @allowed_user_policies = []
      else
        @allowed_user_policies = Array.new(v.length)
        v.each_with_index do |v1, i1|
          raise TypeError, "'v1' expected String, got #{v1.class}" unless v1.is_a? String
          @allowed_user_policies[i1] = v1
        end
      end
    else
      @unknown_json_fields[k] = v
    end
  end
end

def from_json(json_string)

Parameters:
  • json_string (String) -- The complete object in JSON format
def from_json(json_string)
  raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
  from_hash(JSON.parse(json_string))
end

def initialize

def initialize
  clear
end

def to_h

Returns:
  • (Hash) - The complete object as a Ruby hash
def to_h
  to_hash
end

def to_hash

Returns:
  • (Hash) - The complete object as a Ruby hash
def to_hash
  ret = {}
  unless @prevent_edit_server_settings.nil?
    ret['PreventEditServerSettings'] = @prevent_edit_server_settings
  end
  unless @prevent_server_shutdown.nil?
    ret['PreventServerShutdown'] = @prevent_server_shutdown
  end
  unless @prevent_change_password.nil?
    ret['PreventChangePassword'] = @prevent_change_password
  end
  unless @allow_edit_branding.nil?
    ret['AllowEditBranding'] = @allow_edit_branding
  end
  unless @allow_edit_email_options.nil?
    ret['AllowEditEmailOptions'] = @allow_edit_email_options
  end
  unless @allow_edit_remote_storage.nil?
    ret['AllowEditRemoteStorage'] = @allow_edit_remote_storage
  end
  unless @allow_edit_webhooks.nil?
    ret['AllowEditWebhooks'] = @allow_edit_webhooks
  end
  unless @allow_edit_external_auth_sources.nil?
    ret['AllowEditExternalAuthSources'] = @allow_edit_external_auth_sources
  end
  unless @deny_constellation_role.nil?
    ret['DenyConstellationRole'] = @deny_constellation_role
  end
  unless @deny_view_server_history.nil?
    ret['DenyViewServerHistory'] = @deny_view_server_history
  end
  unless @deny_view_server_info.nil?
    ret['DenyViewServerInfo'] = @deny_view_server_info
  end
  unless @prevent_request_storage_vault.nil?
    ret['PreventRequestStorageVault'] = @prevent_request_storage_vault
  end
  unless @prevent_add_custom_storage_vault.nil?
    ret['PreventAddCustomStorageVault'] = @prevent_add_custom_storage_vault
  end
  unless @hide_cloud_storage_branding.nil?
    ret['HideCloudStorageBranding'] = @hide_cloud_storage_branding
  end
  unless @should_restrict_provider_list.nil?
    ret['ShouldRestrictProviderList'] = @should_restrict_provider_list
  end
  unless @allowed_providers_when_restricted.nil?
    ret['AllowedProvidersWhenRestricted'] = @allowed_providers_when_restricted
  end
  unless @allowed_user_policies.nil?
    ret['AllowedUserPolicies'] = @allowed_user_policies
  end
  @unknown_json_fields.each do |k, v|
    ret[k] = v
  end
  ret
end

def to_json(options = {})

Returns:
  • (String) - The complete object as a JSON string
def to_json(options = {})
  to_hash.to_json(options)
end