Class: UffizziCore::ApplicationPolicy
- Inherits:
-
Object
- Object
- UffizziCore::ApplicationPolicy
- Defined in:
- app/policies/uffizzi_core/application_policy.rb
Direct Known Subclasses
UffizziCore::Api::Cli::V1::Accounts::ClustersPolicy, UffizziCore::Api::Cli::V1::Accounts::CredentialsPolicy, UffizziCore::Api::Cli::V1::Accounts::ProjectsPolicy, UffizziCore::Api::Cli::V1::AccountsPolicy, UffizziCore::Api::Cli::V1::Projects::Clusters::IngressesPolicy, UffizziCore::Api::Cli::V1::Projects::ClustersPolicy, UffizziCore::Api::Cli::V1::Projects::ComposeFilesPolicy, UffizziCore::Api::Cli::V1::Projects::Deployments::ActivityItemsPolicy, UffizziCore::Api::Cli::V1::Projects::Deployments::ContainersPolicy, UffizziCore::Api::Cli::V1::Projects::Deployments::EventsPolicy, UffizziCore::Api::Cli::V1::Projects::DeploymentsPolicy, UffizziCore::Api::Cli::V1::Projects::SecretsPolicy, UffizziCore::Api::Cli::V1::ProjectsPolicy
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
-
#initialize(context, record) ⇒ ApplicationPolicy
constructor
A new instance of ApplicationPolicy.
Constructor Details
#initialize(context, record) ⇒ ApplicationPolicy
Returns a new instance of ApplicationPolicy.
6 7 8 9 10 11 |
# File 'app/policies/uffizzi_core/application_policy.rb', line 6 def initialize(context, record) raise Pundit::NotAuthorizedError, 'must be logged in' if !context.instance_of?(UffizziCore::WebhooksContext) && context.user.blank? @record = record @context = context end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
4 5 6 |
# File 'app/policies/uffizzi_core/application_policy.rb', line 4 def context @context end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
4 5 6 |
# File 'app/policies/uffizzi_core/application_policy.rb', line 4 def record @record end |