Class: Checken::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/checken/config.rb

Constant Summary collapse

DEFAULT_NAMESPACE_DELIMITER =
":"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#log_pathString

The path where logs should be written to if using the default logger

Returns:

  • (String)


50
51
52
# File 'lib/checken/config.rb', line 50

def log_path
  @log_path ||= "/dev/null"
end

#loggerLogger

A logger class that will be used to log all activities

Returns:

  • (Logger)


42
43
44
# File 'lib/checken/config.rb', line 42

def logger
  @logger ||= Logger.new(log_path)
end

#namespaceObject

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_delimiterString

The delimiter that should be used to separate namespaces in group and permission paths.

Returns:

  • (String)


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

Parameters:

  • value

    the value to set the attribute namespace_optional to.



29
30
31
# File 'lib/checken/config.rb', line 29

def namespace_optional=(value)
  @namespace_optional = value
end

#user_proxy_classClass

The class that should be used to create user proxies.

Returns:

  • (Class)


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_nameSymbol

The method name which will return the current user object in any controller action.

Returns:

  • (Symbol)


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.

Returns:

  • (Boolean)


26
27
28
# File 'lib/checken/config.rb', line 26

def namespace_optional?
  @namespace_optional || false
end