rhino-rails 4.0.0 → 4.0.1
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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 547b86334ce61b25d13d6dccaa977a5821b8bdb3b275a5fb13a8b5b62d1cd0ee
|
|
4
|
+
data.tar.gz: 35f4ffa23101a49ab7c1403abd51aa15a2f1f57ff1c437000e49e394b6d1b8c0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 68dc8254b5a402eb13ca75a7a2d3b2919aef8e1bd6f5f2ffdae273ff5bad6eb69dc34a4aa3ee5bf6c20cd66dc1cdff5b301d1989c54c2101ae4eb4b8b042caae
|
|
7
|
+
data.tar.gz: aae80fedc9b6b03cc433204487b0f03fb6bffeed9805aea056cad1f74398f707882c02e9a434f88cce16618ec83c6b5a617c11d1c00230b45c5edfbc0a8aee23
|
|
@@ -155,7 +155,7 @@ module Rhino
|
|
|
155
155
|
|
|
156
156
|
templates_dir = File.expand_path("../../templates/multi_tenant/policies", __FILE__)
|
|
157
157
|
|
|
158
|
-
%w[organization_policy role_policy].each do |policy|
|
|
158
|
+
%w[organization_policy role_policy user_policy].each do |policy|
|
|
159
159
|
template = File.join(templates_dir, "#{policy}.rb.erb")
|
|
160
160
|
next unless File.exist?(template)
|
|
161
161
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Policy for the User model.
|
|
4
|
+
#
|
|
5
|
+
# Required for Rhino's per-include authorization: when a resource exposes a
|
|
6
|
+
# User relation (e.g. ?include=assignee on Task, ?include=author on Comment,
|
|
7
|
+
# ?include=owner on Project), Pundit looks up UserPolicy. Without this class
|
|
8
|
+
# Pundit raises Pundit::NotDefinedError and the include returns 403, even for
|
|
9
|
+
# roles that have the `users.index` / `users.show` permission granted.
|
|
10
|
+
#
|
|
11
|
+
# Customize per-action behavior or attribute permissions as needed; defaults
|
|
12
|
+
# inherited from Rhino::ResourcePolicy enforce `users.<action>` permission
|
|
13
|
+
# slugs against the user's `user_roles.permissions` array.
|
|
14
|
+
class UserPolicy < Rhino::ResourcePolicy
|
|
15
|
+
end
|
data/lib/rhino/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rhino-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.0.
|
|
4
|
+
version: 4.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bruno Cipolla
|
|
@@ -248,6 +248,7 @@ files:
|
|
|
248
248
|
- lib/rhino/templates/multi_tenant/models/user_role.rb.erb
|
|
249
249
|
- lib/rhino/templates/multi_tenant/policies/organization_policy.rb.erb
|
|
250
250
|
- lib/rhino/templates/multi_tenant/policies/role_policy.rb.erb
|
|
251
|
+
- lib/rhino/templates/multi_tenant/policies/user_policy.rb.erb
|
|
251
252
|
- lib/rhino/templates/multi_tenant/seeders/organization_seeder.rb.erb
|
|
252
253
|
- lib/rhino/templates/multi_tenant/seeders/role_seeder.rb.erb
|
|
253
254
|
- lib/rhino/templates/rhino.rb
|