Class: Parse::ACLScope::Resolution
- Inherits:
-
Struct
- Object
- Struct
- Parse::ACLScope::Resolution
- Defined in:
- lib/parse/acl_scope.rb
Overview
Outcome of resolving a single mongo-direct call's auth kwargs.
Instance Attribute Summary collapse
-
#mode ⇒ Symbol
One of
:session,:master,:public. -
#permission_strings ⇒ Array<String>?
The
_rpermallow-set ready to hand to Parse::ACL.read_predicate. -
#session ⇒ Parse::AtlasSearch::Session::Resolved?
The underlying resolved-session struct (carries role-name set),
nilfor:master. -
#strict_role ⇒ Boolean
When
true, downstream predicate construction (see match_stage_for and rewrite_pipeline) suppresses the implicit"*"(public) grant. -
#user_id ⇒ String?
The resolved user_id, or
nilfor:masterand:public.
Instance Method Summary collapse
Instance Attribute Details
#mode ⇒ Symbol
Returns one of :session, :master, :public.
:session means the caller passed a valid session_token:;
:master means the caller passed master: true; :public
means neither was supplied and the path's require_session_token
toggle is off, so the SDK falls through to public-only ACL
semantics.
67 68 69 70 71 72 |
# File 'lib/parse/acl_scope.rb', line 67 Resolution = Struct.new(:mode, :permission_strings, :user_id, :session, :strict_role, keyword_init: true) do def master?; mode == :master; end def session?; mode == :session; end def public?; mode == :public; end def strict_role?; strict_role == true; end end |
#permission_strings ⇒ Array<String>?
Returns the _rperm allow-set ready to
hand to Parse::ACL.read_predicate. nil for :master —
no injection runs on the master path.
67 68 69 70 71 72 |
# File 'lib/parse/acl_scope.rb', line 67 Resolution = Struct.new(:mode, :permission_strings, :user_id, :session, :strict_role, keyword_init: true) do def master?; mode == :master; end def session?; mode == :session; end def public?; mode == :public; end def strict_role?; strict_role == true; end end |
#session ⇒ Parse::AtlasSearch::Session::Resolved?
Returns the
underlying resolved-session struct (carries role-name set),
nil for :master.
67 68 69 70 71 72 |
# File 'lib/parse/acl_scope.rb', line 67 Resolution = Struct.new(:mode, :permission_strings, :user_id, :session, :strict_role, keyword_init: true) do def master?; mode == :master; end def session?; mode == :session; end def public?; mode == :public; end def strict_role?; strict_role == true; end end |
#strict_role ⇒ Boolean
Returns when true, downstream predicate construction
(see Parse::ACLScope.match_stage_for and Parse::ACLScope.rewrite_pipeline) suppresses the
implicit "*" (public) grant. Only meaningful for role-scoped
resolutions where the caller wants to see ONLY rows whose
_rperm explicitly includes one of the resolved role names,
not every public-readable row in the collection. Defaults to
false for backwards compatibility. Note: even with
strict_role: true, rows with NO _rperm field still pass
(Parse-Server treats absent _rperm as public-default); the
knob only suppresses the "*" subscription in the $in set.
67 68 69 70 71 72 |
# File 'lib/parse/acl_scope.rb', line 67 Resolution = Struct.new(:mode, :permission_strings, :user_id, :session, :strict_role, keyword_init: true) do def master?; mode == :master; end def session?; mode == :session; end def public?; mode == :public; end def strict_role?; strict_role == true; end end |
#user_id ⇒ String?
Returns the resolved user_id, or nil for
:master and :public.
67 68 69 70 71 72 |
# File 'lib/parse/acl_scope.rb', line 67 Resolution = Struct.new(:mode, :permission_strings, :user_id, :session, :strict_role, keyword_init: true) do def master?; mode == :master; end def session?; mode == :session; end def public?; mode == :public; end def strict_role?; strict_role == true; end end |
Instance Method Details
#master? ⇒ Boolean
68 |
# File 'lib/parse/acl_scope.rb', line 68 def master?; mode == :master; end |
#public? ⇒ Boolean
70 |
# File 'lib/parse/acl_scope.rb', line 70 def public?; mode == :public; end |
#session? ⇒ Boolean
69 |
# File 'lib/parse/acl_scope.rb', line 69 def session?; mode == :session; end |
#strict_role? ⇒ Boolean
71 |
# File 'lib/parse/acl_scope.rb', line 71 def strict_role?; strict_role == true; end |