flexible_accessibility 0.2.9.pre → 0.2.95.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -4,9 +4,10 @@ A simple library for setting access rules, based on analysis of current resource
4
4
 
5
5
  Installation:
6
6
 
7
- gem install flexible_accessibility
7
+ gem install flexible_accessibility
8
8
 
9
- or add to your Gemfile
9
+ or add to your Gemfile
10
10
 
11
- gem "flexible_accesibility", "~> 0.3.0"
11
+ gem "flexible_accesibility", "~> 0.3.0"
12
+
12
13
  ======================
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ require 'jeweler'
15
15
  Jeweler::Tasks.new do |gem|
16
16
  # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
17
  gem.name = "flexible_accessibility"
18
- gem.version = "0.2.9.pre"
18
+ gem.version = "0.2.95.pre"
19
19
  gem.homepage = "http://github.com/mochnatiy/flexible_accessibility"
20
20
  gem.license = "MIT"
21
21
  gem.summary = %Q{Flexible access control system}
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "flexible_accessibility"
8
- s.version = "0.2.9.pre"
8
+ s.version = "0.2.95.pre"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Sergey Awanesov"]
12
- s.date = "2012-09-03"
12
+ s.date = "2012-09-04"
13
13
  s.description = "Flexible access control system for your rails application. Based on analysis of controller actions"
14
14
  s.email = "sergey.awanesov@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -17,12 +17,13 @@ module FlexibleAccessibility
17
17
  end
18
18
 
19
19
  class << self
20
+ # TODO: this function may be recursive because nesting may be existed
20
21
  def all
21
22
  permissions = []
22
23
  Utils.new.get_controllers.each do |scope|
23
24
  namespace = scope.first.to_s
24
- (scope.last - [namespace]).each do |resource|
25
- resource = "#{namespace}::#{resource}" unless namespace == "default"
25
+ scope.last.each do |resource|
26
+ resource = "#{namespace}/#{resource}" unless namespace == "default"
26
27
  permissions << Permission.new(:resource => resource.gsub(/_controller/, "").to_sym, :actions => ApplicationResource.new(resource).klass.instance_variable_get(:@_checkable_routes))
27
28
  end
28
29
  end
@@ -4,8 +4,8 @@ module FlexibleAccessibility
4
4
  attr_reader :namespace
5
5
 
6
6
  def initialize resource_string
7
- @controller = resource_string.split("::").last
8
- @namespace = resource_string.split("::").first
7
+ @controller = resource_string.split("/").last
8
+ @namespace = resource_string.split("/").first == @controller ? "default" : resource_string.split("/").last
9
9
  end
10
10
 
11
11
  def klass
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flexible_accessibility
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1557822611
5
- prerelease: 6
4
+ hash: -1060692565
5
+ prerelease: 7
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 9
9
+ - 95
10
10
  - pre
11
- version: 0.2.9.pre
11
+ version: 0.2.95.pre
12
12
  platform: ruby
13
13
  authors:
14
14
  - Sergey Awanesov
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-09-03 00:00:00 Z
19
+ date: 2012-09-04 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  requirement: &id001 !ruby/object:Gem::Requirement