Class: Parse::Constraint::ACLWritableByRoleConstraint
- Inherits:
-
Constraint
- Object
- Constraint
- Parse::Constraint::ACLWritableByRoleConstraint
- Defined in:
- lib/parse/query/constraints.rb
Overview
A constraint for filtering objects writable by specific role names. Automatically adds "role:" prefix to role names.
Find objects writable by Admin role (string - adds role: prefix)
Post.where(:ACL.writable_by_role => "Admin")
Find objects writable by Role object
Post.where(:ACL.writable_by_role => admin_role)
Find objects writable by multiple roles
Post.where(:ACL.writable_by_role => ["Admin", "Moderator"])
Instance Method Summary collapse
-
#build ⇒ Hash
The compiled constraint using _wperm field.
- #writable_by_role ⇒ ACLWritableByRoleConstraint
Instance Method Details
#build ⇒ Hash
Returns the compiled constraint using _wperm field.
2789 2790 2791 2792 |
# File 'lib/parse/query/constraints.rb', line 2789 def build = ACLPermissions.collect_role_only(@value) ACLPermissions.pipeline(, field: "_wperm") end |
#writable_by_role ⇒ ACLWritableByRoleConstraint
2786 |
# File 'lib/parse/query/constraints.rb', line 2786 register :writable_by_role |