Module: Katello::Authorization::Product

Extended by:
ActiveSupport::Concern
Includes:
Authorizable
Included in:
Product
Defined in:
app/models/katello/authorization/product.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#deletable?Boolean

Returns:

  • (Boolean)


20
21
22
23
# File 'app/models/katello/authorization/product.rb', line 20

def deletable?
  promoted_repos = repositories.select { |repo| repo.promoted? }
  authorized?(:destroy_products) && promoted_repos.empty?
end

#editable?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'app/models/katello/authorization/product.rb', line 16

def editable?
  authorized?(:edit_products)
end

#readable?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'app/models/katello/authorization/product.rb', line 8

def readable?
  authorized?(:view_products)
end

#syncable?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'app/models/katello/authorization/product.rb', line 12

def syncable?
  authorized?(:sync_products)
end