Module: Monty::Configuration
- Defined in:
- lib/monty/configuration.rb
Class Attribute Summary collapse
-
.access_denied_path ⇒ Object
Path to redirect to if access is denied.
-
.permissions ⇒ Object
Array of permission objects that defines the access to the application.
-
.protected_access ⇒ Object
Array of paths that are restricted to an authenticated user.
-
.public_access ⇒ Object
Regex string of paths that are publicly accessible.
Class Method Summary collapse
- .has_permission?(permission) ⇒ Boolean
-
.reset ⇒ Object
Set defaults.
Class Attribute Details
.access_denied_path ⇒ Object
Path to redirect to if access is denied. Default: ‘/’
8 9 10 |
# File 'lib/monty/configuration.rb', line 8 def access_denied_path @access_denied_path end |
.permissions ⇒ Object
Array of permission objects that defines the access to the application. Default []
17 18 19 |
# File 'lib/monty/configuration.rb', line 17 def @permissions end |
.protected_access ⇒ Object
Array of paths that are restricted to an authenticated user. Default “”
14 15 16 |
# File 'lib/monty/configuration.rb', line 14 def protected_access @protected_access end |
.public_access ⇒ Object
Regex string of paths that are publicly accessible. Default “/”
11 12 13 |
# File 'lib/monty/configuration.rb', line 11 def public_access @public_access end |
Class Method Details
.has_permission?(permission) ⇒ Boolean
27 28 29 |
# File 'lib/monty/configuration.rb', line 27 def () .any?{|p| .name == p.name} end |
.reset ⇒ Object
Set defaults.
20 21 22 23 24 25 |
# File 'lib/monty/configuration.rb', line 20 def reset @access_denied_path = "/" @public_access = "" @protected_access = "" @permissions = [] end |