four_eyes 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +24 -5
  3. data/lib/four_eyes/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 144c62f42d4650a3ef5a4894cbcb0e2ac728e78e
4
- data.tar.gz: 338ed6f1367d8104d38ad10657cd9ad18609013e
3
+ metadata.gz: 50fdcf432e727f3c0b6f2a78ce41868b5988aad4
4
+ data.tar.gz: 15663bb4f542714eadb56fa44c19e5b05bca28dc
5
5
  SHA512:
6
- metadata.gz: 0012d1d26e754304085e751c0497d03e2762f140f6a1320b681b8aa9f030e653192b1c2acded7059fbe80538518b8af989e7a609945581041bb70217ea1f316d
7
- data.tar.gz: 582281c8a1cb15469682a5546ddca7ea27bc2fc98c0d84d447386658b01743ef0bce8bbb9e1fefb9e7ae676ecac989cd711fdaa3e9e826c290d014552f0cd68e
6
+ metadata.gz: 5053d22ef3d8fa86cd48b2ff9ba935598f1a649fa9a64f0bb398c2b4c9323dafdcf4152df52e9d6200f7575a111e262cdbeeac8b87097d94d1f58ff230522855
7
+ data.tar.gz: 7407011253cbf4f0f9d5b4161677ac46600682884941c25a45d265705fc148f4f4296ba0dd9f076911b0853dd6025621e0767c6ad57406c6af2349c83ff73fca
data/README.md CHANGED
@@ -20,9 +20,9 @@ responsible for performing the validation check to see if the resource is indeed
20
20
  the system state may change before authorization to a state that renders the action invalid. In such a scenario, the action
21
21
  would need to be cancelled and created again.
22
22
 
23
- A listing of all pending actions can be availed and depending on any authorization mechanisim that you have implemented, a user can then access a pending
23
+ A listing of all pending actions can be availed and depending on any authorization mechanism that you have implemented, a user can then access a pending
24
24
  action and authorize it.
25
-
25
+
26
26
  ## Installation
27
27
 
28
28
  Add this line to your application's Gemfile:
@@ -66,12 +66,12 @@ To add maker checker functionality, add the following before_filter to the contr
66
66
 
67
67
  Once that is done, in the create, update or delete action you would call the following
68
68
 
69
- maker_create([User resource performaing the action],
69
+ maker_create([User resource performing the action],
70
70
  [ID of resource performing the action],
71
71
  [Class name of the resource being worked on],
72
72
  [Parameters of oject/resource in JSON format])
73
73
 
74
- For exeample, in a system where the users are called Administrators, and the resource we are trying to create via
74
+ For example, in a system where the users are called Administrators, and the resource we are trying to create via
75
75
  maker checker is a Student, the call to create a student via maker-checker would look like this.
76
76
 
77
77
 
@@ -96,7 +96,26 @@ To add maker checker functionality, add the following before_filter to the contr
96
96
  student.to_json)
97
97
  end
98
98
 
99
- where in the example above, the call has the following format
99
+ Minimal vies have been provided for viewing pending and authorized actions. You will probably want to override these
100
+ and style them accordingly to your application.
101
+
102
+ Please note four_ayes is agnostic for the type of authorization system you are using. Right now the only check that is performed is
103
+ ensuring that the maker of an action cannot be the same person to authorize an action. You can extend this to your own authorization
104
+ system. For example using CanCan you can have something like this for a certain role:
105
+
106
+
107
+
108
+ class AdminAbility
109
+ include CanCan::Ability
110
+
111
+ def initialize(admin)
112
+ admin ||= Administrator.new
113
+ if admin.role? :Manager
114
+ can :authorize, FourEyes::Action, object_resource_class_name: %w(Student Teacher)
115
+ can :cancel, FourEyes::Action
116
+ end
117
+ end
118
+ end
100
119
 
101
120
  ## TODO - Write spec tests.
102
121
 
@@ -1,3 +1,3 @@
1
1
  module FourEyes
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: four_eyes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dennis Ondeng