Module: Lockdown
- Extended by:
- Helper, References
- Defined in:
- lib/lockdown.rb,
lib/lockdown/rules.rb,
lib/lockdown/errors.rb,
lib/lockdown/helper.rb,
lib/lockdown/system.rb,
lib/lockdown/context.rb,
lib/lockdown/session.rb,
lib/lockdown/database.rb,
lib/lockdown/permission.rb,
lib/lockdown/references.rb,
lib/lockdown/rspec_helper.rb,
lib/lockdown/frameworks/rails.rb,
lib/lockdown/orms/active_record.rb,
lib/lockdown/frameworks/rails/view.rb,
lib/lockdown/frameworks/rails/controller.rb
Defined Under Namespace
Modules: Frameworks, Helper, Orms, References, RspecHelper, Rules, Session Classes: Context, Controller, ControllerContext, Database, GroupUndefinedError, InvalidPermissionAssignment, InvalidRuleAssignment, InvalidRuleContext, Model, ModelContext, ModelWhereContext, Permission, PermissionScopeCollision, RootContext, System
Constant Summary collapse
- VERSION =
'1.6.2.1'
Class Attribute Summary collapse
-
.logger ⇒ Object
Returns the value of attribute logger.
Class Method Summary collapse
- .major_version ⇒ Object
-
.maybe_parse_init ⇒ Object
mixin.
- .minor_version ⇒ Object
-
.mixin ⇒ Object
Mixin Lockdown code to the appropriate framework and ORM.
- .patch_version ⇒ Object
-
.version ⇒ Object
Returns the version string for the library.
Methods included from References
helper, rules, session, system
Methods included from Helper
administrator_group_string, administrator_group_symbol, camelize, class_name_from_file, convert_reference_name, get_string, get_symbol, random_string, user_class, user_group_class, user_group_id_reference, user_group_model_string, user_groups_hbtm_reference, user_id_reference, user_model_string, users_hbtm_reference
Class Attribute Details
.logger ⇒ Object
Returns the value of attribute logger.
22 23 24 |
# File 'lib/lockdown.rb', line 22 def logger @logger end |
Class Method Details
.major_version ⇒ Object
29 30 31 |
# File 'lib/lockdown.rb', line 29 def major_version version.split('.')[0].to_i end |
.maybe_parse_init ⇒ Object
mixin
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/lockdown.rb', line 52 def maybe_parse_init return if Lockdown::System.initialized? if File.exists?(Lockdown.init_file) Lockdown.logger.info "=> Requiring Lockdown rules engine: #{Lockdown.init_file} \n" load Lockdown.init_file else Lockdown.logger.info "=> Note:: Lockdown couldn't find init file: #{Lockdown.init_file}\n" end end |
.minor_version ⇒ Object
33 34 35 |
# File 'lib/lockdown.rb', line 33 def minor_version version.split('.')[1].to_i end |
.mixin ⇒ Object
Mixin Lockdown code to the appropriate framework and ORM
42 43 44 45 46 47 48 49 50 |
# File 'lib/lockdown.rb', line 42 def mixin if mixin_resource?("frameworks") unless mixin_resource?("orms") raise NotImplementedError, "ORM unknown to Lockdown!" end else Lockdown.logger.info "=> Note:: Lockdown cannot determine framework and therefore is not active.\n" end end |
.patch_version ⇒ Object
37 38 39 |
# File 'lib/lockdown.rb', line 37 def patch_version version.split('.')[2].to_i end |
.version ⇒ Object
Returns the version string for the library.
25 26 27 |
# File 'lib/lockdown.rb', line 25 def version VERSION end |