Class: Checken::Config
- Inherits:
-
Object
- Object
- Checken::Config
- Defined in:
- lib/checken/config.rb
Constant Summary collapse
- DEFAULT_NAMESPACE_DELIMITER =
":"
Instance Attribute Summary collapse
-
#log_path ⇒ String
The path where logs should be written to if using the default logger.
-
#logger ⇒ Logger
A logger class that will be used to log all activities.
-
#namespace ⇒ Object
An optional namespace that will prefix all group and permission paths.
-
#namespace_delimiter ⇒ String
The delimiter that should be used to separate namespaces in group and permission paths.
-
#namespace_optional ⇒ Object
writeonly
Sets the attribute namespace_optional.
-
#user_proxy_class ⇒ Class
The class that should be used to create user proxies.
Instance Method Summary collapse
-
#current_user_method_name ⇒ Symbol
The method name which will return the current user object in any controller action.
-
#namespace_optional? ⇒ Boolean
Should the namespace be optional when checking permissions? Defaults to false.
Instance Attribute Details
#log_path ⇒ String
The path where logs should be written to if using the default logger
50 51 52 |
# File 'lib/checken/config.rb', line 50 def log_path @log_path ||= "/dev/null" end |
#logger ⇒ Logger
A logger class that will be used to log all activities
42 43 44 |
# File 'lib/checken/config.rb', line 42 def logger @logger ||= Logger.new(log_path) end |
#namespace ⇒ Object
An optional namespace that will prefix all group and permission paths.
11 12 13 |
# File 'lib/checken/config.rb', line 11 def namespace @namespace end |
#namespace_delimiter ⇒ String
The delimiter that should be used to separate namespaces in group and permission paths.
17 18 19 |
# File 'lib/checken/config.rb', line 17 def namespace_delimiter @namespace_delimiter ||= DEFAULT_NAMESPACE_DELIMITER end |
#namespace_optional=(value) ⇒ Object (writeonly)
Sets the attribute namespace_optional
29 30 31 |
# File 'lib/checken/config.rb', line 29 def namespace_optional=(value) @namespace_optional = value end |
#user_proxy_class ⇒ Class
The class that should be used to create user proxies.
34 35 36 |
# File 'lib/checken/config.rb', line 34 def user_proxy_class @user_proxy_class ||= UserProxy end |
Instance Method Details
#current_user_method_name ⇒ Symbol
The method name which will return the current user object in any controller action.
59 60 61 |
# File 'lib/checken/config.rb', line 59 def current_user_method_name @current_user_method_name || :current_user end |
#namespace_optional? ⇒ Boolean
Should the namespace be optional when checking permissions? Defaults to false.
26 27 28 |
# File 'lib/checken/config.rb', line 26 def namespace_optional? @namespace_optional || false end |