forked from hasura/graphql-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server: fix inherited_roles issue when some of the underlying roles d…
…on't have permissions configured GitOrigin-RevId: 771491e
- Loading branch information
1 parent
478c01a
commit 395de58
Showing
9 changed files
with
138 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...ery/permissions/inherited_roles/inherited_role_with_some_roles_having_no_permissions.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
description: | | ||
Suppose an inherited role `ir1` is created out of role1, role2 and role3. role1 and role2 have some select | ||
permissions configured for a Table T and role3 doesn't have any select permissions configured for T. In such cases, the inherited role `ir1` should work as if the inherited role is created out of only role1 and role2 or the inherited role's permissions should be only constructed out of the permissions which exist for the underlying roles. In this case, the | ||
`guest` role doesn't have select permissions configured for the table `author` | ||
url: /v1/graphql | ||
status: 200 | ||
headers: | ||
X-Hasura-Role: author_editor_guest_inherited_role | ||
X-Hasura-Author-Id: '1' | ||
X-Hasura-Editor-Id: '1' | ||
query: | ||
query: | | ||
query { | ||
authors { | ||
id | ||
name | ||
followers | ||
} | ||
} | ||
reponse: | ||
data: | ||
authors: | ||
- id: 1 | ||
name: J.K.Rowling | ||
followers: 1232344 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
server/tests-py/queries/graphql_query/permissions/inherited_roles/schema_teardown.sql
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ args: | |
DROP TABLE employee CASCADE; | ||
DROP TABLE manager; | ||
DROP TABLE team; | ||
DROP TABLE articles; | ||
DROP TABLE authors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 8 additions & 2 deletions
10
server/tests-py/queries/graphql_query/permissions/inherited_roles/teardown.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
type: drop_inherited_role | ||
type: bulk | ||
args: | ||
role_name: manager_employee | ||
- type: drop_inherited_role | ||
args: | ||
role_name: manager_employee | ||
|
||
- type: drop_inherited_role | ||
args: | ||
role_name: author_editor_guest_inherited_role |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters