Class: Refinery::Core::NilUser
- Inherits:
-
Zilch::Authorisation::NilUser
- Object
- Zilch::Authorisation::NilUser
- Refinery::Core::NilUser
- Defined in:
- lib/refinery/core/nil_user.rb
Instance Method Summary collapse
-
#active_plugins ⇒ Object
Returns all plugins that the user has access to, that are currently loaded in the system.
-
#has_plugin?(name) ⇒ Boolean
Returns true.
-
#has_role?(role) ⇒ Boolean
The default NilUser has all roles and can access all plugins.
-
#landing_url ⇒ Object
Returns a URL to the first plugin with a URL in the menu.
-
#plugins ⇒ Object
Returns all registered plugins.
Instance Method Details
#active_plugins ⇒ Object
Returns all plugins that the user has access to, that are currently loaded in the system. For NilUser, this returns all registered plugins. Should be overridden in authentication solutions
17 18 19 |
# File 'lib/refinery/core/nil_user.rb', line 17 def active_plugins Refinery::Plugins.registered end |
#has_plugin?(name) ⇒ Boolean
Returns true. Should be overridden in authentication solutions. A real solution might be: ‘Refinery::Plugins.active.names.include?(name)`
30 31 32 |
# File 'lib/refinery/core/nil_user.rb', line 30 def has_plugin?(name) true end |
#has_role?(role) ⇒ Boolean
The default NilUser has all roles and can access all plugins. Should be overridden in authentication solutions.
9 10 11 |
# File 'lib/refinery/core/nil_user.rb', line 9 def has_role?(role) true end |
#landing_url ⇒ Object
Returns a URL to the first plugin with a URL in the menu. Used for admin users’ root admin url. Should be overridden in authentication solutions.
37 38 39 |
# File 'lib/refinery/core/nil_user.rb', line 37 def landing_url active_plugins. end |
#plugins ⇒ Object
Returns all registered plugins. Should be overridden in authentication solutions.
23 24 25 |
# File 'lib/refinery/core/nil_user.rb', line 23 def plugins Refinery::Plugins.registered end |