You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhances the Parse::CLP class and Parse::Object DSL to support default permissions for all operations, pointer-based permissions (readUserFields, writeUserFields), and improved snake_case to camelCase field conversion. Updates integration and unit tests to cover new features, including default permission propagation, pointer permissions, and field name conversions.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+63-3Lines changed: 63 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,48 @@
2
2
3
3
### 3.2.1
4
4
5
+
#### New Features
6
+
7
+
-**NEW**: Added `set_default_clp` method to set a default permission for all CLP operations at once. This is important because Parse Server treats missing operations as `{}` (no access, master key only).
8
+
9
+
```ruby
10
+
classDocument < Parse::Object
11
+
# Set all operations to public by default
12
+
set_default_clp public:true
13
+
14
+
# Or require authentication for all operations
15
+
set_default_clp requires_authentication:true
16
+
17
+
# Or restrict all operations to specific roles
18
+
set_default_clp roles: ["Admin", "Editor"]
19
+
20
+
# Then override specific operations as needed
21
+
set_clp :delete, public:false, roles: ["Admin"]
22
+
end
23
+
```
24
+
25
+
-**NEW**: Added `set_read_user_fields` and `set_write_user_fields` for pointer-based permissions. These allow users referenced by pointer fields to have read/write access to objects.
26
+
27
+
```ruby
28
+
classDocument < Parse::Object
29
+
belongs_to :owner, as::user
30
+
belongs_to :editor, as::user
31
+
32
+
# Owner can read, editor can write
33
+
set_read_user_fields [:owner]
34
+
set_write_user_fields [:editor]
35
+
36
+
# Snake_case field names are auto-converted to camelCase
37
+
end
38
+
```
39
+
40
+
-**NEW**: Added `reset_clp!` method to reset CLPs to public defaults. Useful for clearing restrictive permissions that may have accumulated on the server.
41
+
42
+
```ruby
43
+
# Reset all CLPs to public access
44
+
Song.reset_clp!
45
+
```
46
+
5
47
#### Improvements
6
48
7
49
-**IMPROVED**: CLP methods now automatically convert snake_case Ruby property names to camelCase Parse Server field names. This provides consistency with the rest of the Parse Stack framework where you define properties in snake_case.
# Converts to: pointerFields: ["ownerField", "editorField"]
42
84
end
43
85
```
44
86
87
+
-**IMPROVED**: Added `include_defaults` parameter to `CLP#as_json`. When `true`, includes default permissions for all undefined operations (useful when pushing complete CLP to server).
88
+
89
+
```ruby
90
+
clp =Parse::CLP.new
91
+
clp.set_default_permission(public:true)
92
+
clp.set_permission(:delete, roles: ["Admin"])
93
+
94
+
# Without defaults - only explicitly set operations
-**FIXED**: `auto_upgrade!` now resets CLPs before applying new ones. Parse Server merges CLP updates rather than replacing them, so old restrictive permissions could persist and cause "Permission denied" errors. Now `auto_upgrade!` first resets CLPs to public defaults, then applies the model's CLP configuration.
106
+
47
107
-**FIXED**: Test setup for role membership now correctly uses `add_users()` method for adding users to roles (roles use Parse Relations, not Array properties).
0 commit comments