Commit graph

1 commit

Author SHA1 Message Date
makiaveli1
8be1384279
Fix lost actor/action params for plugin permission rules
gather_permission_sql_from_hooks() adds :actor, :actor_id and :action
defaults to each PermissionSQL returned by the permission_resources_sql
hook, but "params = permission_sql.params or {}" built a throwaway dict
whenever a rule passed no params of its own (None or {}), so those
defaults were silently discarded.

The anonymous pass in build_allowed_resources_sql() rewrites plugin SQL by
iterating over permission_sql.params and renaming :key to :anon_key. With
no params attached, a rule that references :actor is never rewritten, so
the anonymous branch binds :actor to the current actor instead of NULL.
A table that anonymous users cannot view is then reported as
is_private=0, and its deny/allow reason is computed for the wrong actor.
2026-09-30 16:59:40 +01:00