Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for RBAC on apps built from templates containing public screens #5134

Merged
merged 1 commit into from
Mar 28, 2022

Conversation

mike12345567
Copy link
Collaborator

@mike12345567 mike12345567 commented Mar 28, 2022

Description

Fix for #5103 - some templates are built on an older version that stored permissions differently, we can't migrate these as they will keep being added, easiest to just support the old method (apply the old rule and convert to the new format when retrieving roles).

This fixes the templates which contain public roles, converted the roles which are stored as:

"ta_a889aa4c78b14eedaaf2765e30558054": "write"

to

"ta_d0eaf94963834567ba4fc083d7072118": [
      "write",
      "read"
    ]

Which is the new method. Previously "write" as a string implied "read" but that was updated a little while ago. Its easy enough to convert this when reading roles and resolve the issue where used, making use of the older rule that write is a higher level than read.

This also introduces the ability to set a public write, but have a basic read, and the table schema will use the lower of the two roles which provides it access - table schemas see if either of the levels would provide access using the { schema: true } option on the authorized middleware.

…red permissions differently, we can't migrate these as they will keep being added, easiest to just support the old method (apply the old rule and convert to the new format when retrieving roles).
Copy link
Member

@shogunpurple shogunpurple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Great job getting that fix in - should solve a lot of issues.

@mike12345567 mike12345567 merged commit ac129ce into master Mar 28, 2022
@mike12345567 mike12345567 deleted the fix/5103 branch March 28, 2022 16:17
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants