mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-11 00:41:41 +08:00
Fix with_granted_permission scope query [SCI-12377]
This commit is contained in:
parent
b2ace83571
commit
ff0b871844
1 changed files with 3 additions and 3 deletions
|
|
@ -22,11 +22,11 @@ module PermissionCheckableModel
|
||||||
.where(team_assignments: { assignable: self, team_id: teams })
|
.where(team_assignments: { assignable: self, team_id: teams })
|
||||||
.where('user_roles.permissions @> ARRAY[?]::varchar[]', permissions)
|
.where('user_roles.permissions @> ARRAY[?]::varchar[]', permissions)
|
||||||
|
|
||||||
where(id: from("(#{with_granted_user_permissions.to_sql} " \
|
where(id: from("((#{with_granted_user_permissions.to_sql}) " \
|
||||||
"UNION " \
|
"UNION " \
|
||||||
"#{with_granted_group_permissions.to_sql} " \
|
"(#{with_granted_group_permissions.to_sql}) " \
|
||||||
"UNION " \
|
"UNION " \
|
||||||
"#{with_granted_team_permissions.to_sql} " \
|
"(#{with_granted_team_permissions.to_sql}) " \
|
||||||
") AS #{table_name}", table_name)
|
") AS #{table_name}", table_name)
|
||||||
.reselect(:id))
|
.reselect(:id))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue