Class: RubyUIAdmin::BasePolicy
- Inherits:
-
ActionPolicy::Base
- Object
- ActionPolicy::Base
- RubyUIAdmin::BasePolicy
- Defined in:
- lib/ruby_ui_admin/base_policy.rb
Overview
Base class for admin policies. Host policies (RubyUIAdmin::Policies::*) inherit
from this. It lives outside the RubyUIAdmin::Policies namespace so Zeitwerk can
fully own that namespace for host-defined policies.
Migration note: a host's existing base policy maps to this class.
manage? is action_policy's default rule (fallback for any rule the host policy
doesn't define). We defer it to explicit_authorization: when explicit_authorization
is false, undefined rules are allowed; when true, they are denied.
Instance Method Summary collapse
- #create? ⇒ Boolean
-
#index? ⇒ Boolean
index?andcreate?are concretely defined asfalseby action_policy's Defaults module, so redirect them to the same fallback as every other rule. - #manage? ⇒ Boolean
Instance Method Details
#create? ⇒ Boolean
30 |
# File 'lib/ruby_ui_admin/base_policy.rb', line 30 def create? = manage? |
#index? ⇒ Boolean
index? and create? are concretely defined as false by action_policy's
Defaults module, so redirect them to the same fallback as every other rule.
28 |
# File 'lib/ruby_ui_admin/base_policy.rb', line 28 def index? = manage? |
#manage? ⇒ Boolean
22 23 24 |
# File 'lib/ruby_ui_admin/base_policy.rb', line 22 def manage? !RubyUIAdmin.configuration. end |