Module: Authorization::System::ClassMethods
- Defined in:
- app/models/katello/authorization/system.rb
Instance Method Summary collapse
- #all_editable?(content_view, environments) ⇒ Boolean
- #any_editable? ⇒ Boolean
- #deletable ⇒ Object
- #editable ⇒ Object
- #readable ⇒ Object
- #readable? ⇒ Boolean
- #readable_search_filters(_org) ⇒ Object
Instance Method Details
#all_editable?(content_view, environments) ⇒ Boolean
47 48 49 50 |
# File 'app/models/katello/authorization/system.rb', line 47 def all_editable?(content_view, environments) systems_query = System.where(:content_view_id => content_view, :environment_id => environments) systems_query.count == systems_query.editable.count end |
#any_editable? ⇒ Boolean
43 44 45 |
# File 'app/models/katello/authorization/system.rb', line 43 def any_editable? (:edit_content_hosts).count > 0 end |
#deletable ⇒ Object
39 40 41 |
# File 'app/models/katello/authorization/system.rb', line 39 def deletable (:destroy_content_hosts) end |
#editable ⇒ Object
35 36 37 |
# File 'app/models/katello/authorization/system.rb', line 35 def editable (:edit_content_hosts) end |
#readable ⇒ Object
27 28 29 |
# File 'app/models/katello/authorization/system.rb', line 27 def readable (:view_content_hosts) end |
#readable? ⇒ Boolean
31 32 33 |
# File 'app/models/katello/authorization/system.rb', line 31 def readable? User.current.can?(:view_content_hosts) end |
#readable_search_filters(_org) ⇒ Object
20 21 22 23 24 25 |
# File 'app/models/katello/authorization/system.rb', line 20 def readable_search_filters(_org) {:or => [ {:terms => {:environment_id => KTEnvironment.readable.pluck(:id) }} ] } end |