debian-mirror-gitlab/app/models/clusters/agents/project_authorization.rb

21 lines
544 B
Ruby
Raw Normal View History

2021-11-11 11:23:49 +05:30
# frozen_string_literal: true
module Clusters
module Agents
class ProjectAuthorization < ApplicationRecord
2021-12-11 22:18:48 +05:30
include ::Clusters::Agents::AuthorizationConfigScopes
2021-11-11 11:23:49 +05:30
self.table_name = 'agent_project_authorizations'
belongs_to :agent, class_name: 'Clusters::Agent', optional: false
belongs_to :project, class_name: '::Project', optional: false
validates :config, json_schema: { filename: 'cluster_agent_authorization_configuration' }
2021-11-18 22:05:49 +05:30
def config_project
agent.project
end
2021-11-11 11:23:49 +05:30
end
end
end