cartodb-4.42/lib/carto/oauth_provider/scopes/datasets_metadata_scope.rb
2024-04-06 05:25:13 +00:00

24 lines
600 B
Ruby

module Carto
module OauthProvider
module Scopes
class DatasetsMetadataScope < DefaultScope
def initialize(description)
super('database', 'metadata', CATEGORY_DATASETS_METADATA, description)
@grant_key = :table_metadata
end
def name
"datasets:metadata"
end
def add_to_api_key_grants(grants, _user = nil)
ensure_includes_apis(grants, ['sql'])
section = grant_section(grants)
section[@grant_key] = []
ensure_grant_section(grants, section)
end
end
end
end
end