isomorfeus-policy 1.0.0.epsilon1 → 1.0.0.epsilon2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a2f26a5f58b1c8dce4bb0439587288e5bf5b38cd48174a25abe6bf24479148d
4
- data.tar.gz: badb0fdc82dd47c5660d737c798f81f8544a640b91e65ceb638c07f43383c290
3
+ metadata.gz: 7a84abd2b51dd65aca89b365e52518bddd9f698fc55e986a5aa8e233b0792d13
4
+ data.tar.gz: d911eaa63ab8b118ae536534167ec08c8df3a0614217222cc2dd00b314ac36ae
5
5
  SHA512:
6
- metadata.gz: d778f99cea46d15f2c21e75e80d11e4877d89908012c9610aad44da71af7873109cc965c49be7be372fc9ff5239d35ed02c69529c6e7828269eaf0945577eb5c
7
- data.tar.gz: 59c041bb5980a783f77ecb5332b4b7e82024ef4be35dd15f0bed4f2c524485c686a2bcf4a809debbbd9c607fdf70407ee642ad93de04562efeecaf56bb5b7347
6
+ metadata.gz: '0686dd1b1db6f15d6e9cdebabb12502d20d544c37fa793618f7a02d43b4d807548acda90aa581f7699dd1489be4338d961cc331fbd98510bcc24bad3afa63a1f'
7
+ data.tar.gz: 65d0c8d6fb748487e2531e130f10599d5863158f4007653245234bbbaf045f86d50c732d3d19522c8ee920332915a52edb858ceb15aa10f172cc116c8c749688
data/README.md CHANGED
@@ -19,6 +19,10 @@ Example Policy:
19
19
  deny BlaGraph, SuperOperation
20
20
 
21
21
  deny others # or: allow others
22
+
23
+ # in a otherwise empty policy the following can be used too:
24
+ # allow all
25
+ # deny all
22
26
 
23
27
  with_condition do |user_or_role_instance, target_class, target_method, *props|
24
28
  role.class == AdminRole
data/lib/anonymous.rb ADDED
@@ -0,0 +1,6 @@
1
+ class Anonymous
2
+ # policy methods get added by Isomorfeus::Transport::AnonymousPolicy
3
+ def id
4
+ 'anonymous'
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ module Isomorfeus
2
+ module Policy
3
+ class AnonymousPolicy < LucidPolicy::Base
4
+ policy_for Anonymous
5
+ deny all
6
+ end
7
+ end
8
+ end
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  module Policy
3
- VERSION = '1.0.0.epsilon1'
3
+ VERSION = '1.0.0.epsilon2'
4
4
  end
5
5
  end
@@ -6,6 +6,8 @@ require 'lucid_policy/exception'
6
6
  require 'isomorfeus/policy/helper'
7
7
  require 'lucid_policy/mixin'
8
8
  require 'lucid_policy/base'
9
+ require 'anonymous'
10
+ require 'isomorfeus/policy/anonymous_policy'
9
11
 
10
12
  if RUBY_ENGINE == 'opal'
11
13
  Opal::Autoloader.add_load_path('policies')
@@ -57,6 +57,10 @@ module LucidPolicy
57
57
  @the_class.authorization_rules[self.to_s] = { classes: {}, conditions: [], others: :deny }
58
58
  end
59
59
 
60
+ def all
61
+ :others
62
+ end
63
+
60
64
  def allow(*classes_and_methods)
61
65
  _raise_allow_deny_first if @refine_used
62
66
  _allow_or_deny(:allow, *classes_and_methods)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-policy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.epsilon1
4
+ version: 1.0.0.epsilon2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-16 00:00:00.000000000 Z
11
+ date: 2019-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 16.9.2
47
+ version: 16.9.4
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 16.9.2
54
+ version: 16.9.4
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: isomorfeus-redux
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +66,34 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 4.0.11
69
+ - !ruby/object:Gem::Dependency
70
+ name: isomorfeus-installer
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '='
74
+ - !ruby/object:Gem::Version
75
+ version: 1.0.0.epsilon2
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '='
81
+ - !ruby/object:Gem::Version
82
+ version: 1.0.0.epsilon2
83
+ - !ruby/object:Gem::Dependency
84
+ name: opal-webpack-loader
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 0.9.4
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: 0.9.4
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: rake
71
99
  requirement: !ruby/object:Gem::Requirement
@@ -102,7 +130,9 @@ extra_rdoc_files: []
102
130
  files:
103
131
  - LICENSE
104
132
  - README.md
133
+ - lib/anonymous.rb
105
134
  - lib/isomorfeus-policy.rb
135
+ - lib/isomorfeus/policy/anonymous_policy.rb
106
136
  - lib/isomorfeus/policy/config.rb
107
137
  - lib/isomorfeus/policy/helper.rb
108
138
  - lib/isomorfeus/policy/version.rb