hyper-mesh 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +59 -204
- data/config/routes.rb +1 -1
- data/docs/action_cable_quickstart.md +13 -36
- data/docs/configuration_details.md +62 -0
- data/docs/pusher_faker_quickstart.md +28 -0
- data/docs/pusher_quickstart.md +17 -0
- data/docs/simple_poller_quickstart.md +5 -0
- data/examples/words/Gemfile +4 -3
- data/examples/words/Gemfile.lock +33 -32
- data/examples/words/app/views/components.rb +4 -2
- data/examples/words/config/initializers/hyper_mesh.rb +14 -0
- data/examples/words/config/routes.rb +1 -1
- data/hyper-mesh-0.4.0.gem +0 -0
- data/lib/hyper-mesh.rb +2 -1
- data/lib/hypermesh/version.rb +1 -1
- data/lib/reactive_record/active_record/public_columns_hash.rb +2 -2
- data/lib/reactive_record/active_record/reactive_record/isomorphic_base.rb +1 -1
- data/lib/reactive_record/engine.rb +2 -4
- data/lib/reactive_record/permissions.rb +30 -7
- data/lib/synchromesh/client_drivers.rb +3 -5
- data/lib/synchromesh/connection.rb +34 -8
- data/lib/synchromesh/synchromesh.rb +11 -7
- data/lib/synchromesh/synchromesh_controller.rb +9 -1
- data/path_release_steps.md +9 -0
- data/reactive_record_test_app/Gemfile +2 -1
- data/reactive_record_test_app/Gemfile.lock +6 -6
- data/reactive_record_test_app/config/application.rb +0 -1
- data/reactive_record_test_app/config/initializers/hyper_mesh_legacy_behavior.rb +5 -0
- data/reactive_record_test_app/config/routes.rb +3 -3
- data/spec/reactive_record/edge_cases_spec.rb +1 -1
- data/spec/reactive_record/many_to_many_spec.rb +1 -1
- data/spec/reactive_record/revert_spec.rb +1 -0
- data/spec/reactive_record/update_associations_spec.rb +1 -0
- data/spec/reactive_record/update_scopes_spec.rb +1 -0
- data/spec/synchromesh/crud_access_regulation/broadcast_controls_access_spec.rb +0 -6
- data/spec/synchromesh/crud_access_regulation/model_policies_spec.rb +8 -6
- data/spec/synchromesh/integration/has_many_through_spec.rb +0 -4
- data/spec/test_app/config/routes.rb +1 -1
- data/work-in-progress-drinking.png +0 -0
- metadata +8 -4
- data/examples/words/config/initializers/synchromesh.rb +0 -5
- data/lib/synchromesh/reactive_record/permission_patches.rb +0 -43
@@ -1,43 +0,0 @@
|
|
1
|
-
# acting user is the acting user... okay
|
2
|
-
|
3
|
-
class ActiveRecord::Base
|
4
|
-
|
5
|
-
def view_permitted?(attribute)
|
6
|
-
HyperMesh::InternalPolicy.accessible_attributes_for(self, acting_user).include? attribute.to_sym
|
7
|
-
end
|
8
|
-
|
9
|
-
def create_permitted?
|
10
|
-
false
|
11
|
-
end
|
12
|
-
|
13
|
-
def update_permitted?
|
14
|
-
false
|
15
|
-
end
|
16
|
-
|
17
|
-
def destroy_permitted?
|
18
|
-
false
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
module HyperMesh
|
23
|
-
class InternalPolicy
|
24
|
-
|
25
|
-
def self.accessible_attributes_for(model, acting_user)
|
26
|
-
user_channels = ClassConnectionRegulation.connections_for(acting_user, false) +
|
27
|
-
InstanceConnectionRegulation.connections_for(acting_user, false)
|
28
|
-
internal_policy = InternalPolicy.new(model, model.attribute_names, user_channels)
|
29
|
-
ChannelBroadcastRegulation.broadcast(internal_policy)
|
30
|
-
InstanceBroadcastRegulation.broadcast(model, internal_policy)
|
31
|
-
internal_policy.accessible_attributes_for
|
32
|
-
end
|
33
|
-
|
34
|
-
def accessible_attributes_for
|
35
|
-
accessible_attributes = Set.new
|
36
|
-
@channel_sets.each do |channel, attribute_set|
|
37
|
-
accessible_attributes.merge attribute_set
|
38
|
-
end
|
39
|
-
accessible_attributes << :id unless accessible_attributes.empty?
|
40
|
-
accessible_attributes
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|