Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: implement typed database for custom permissions (breaks existing custom roles)#13457

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Emyrk merged 4 commits intomainfromstevenmasley/custom_roles_dbtype
Jun 4, 2024

Conversation

Emyrk
Copy link
Member

@EmyrkEmyrk commentedJun 3, 2024
edited
Loading

Custom roles in the db were raw json. Using sqlc overrides, I can make these typed which is much better. This is just a refactor. Fixed up the tests to match.

Forgot this was something we could easily do. It removes some converting that we used to have to do.

Any existing custom org roles will be replaced with 0 permissions. This is a change in format.

@EmyrkEmyrk changed the titlechore: typed database custom permissionschore: implement typed database for custom permissionsJun 3, 2024
Comment on lines +1788 to +1790
SitePermissions CustomRolePermissions `db:"site_permissions" json:"site_permissions"`
OrgPermissions CustomRolePermissions `db:"org_permissions" json:"org_permissions"`
UserPermissions CustomRolePermissions `db:"user_permissions" json:"user_permissions"`
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

So much better thanjson.RawMessage

@EmyrkEmyrk requested a review fromjohnstcnJune 3, 2024 21:54
Copy link
Member

@johnstcnjohnstcn left a comment

Choose a reason for hiding this comment

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

LGTM 👍 but probably good to call out that this will invalidate any existing custom roles.

Comment on lines +1 to +3
-- Previous custom roles are now invalid, as the json changed. Since this is an
-- experimental feature, there is no point in trying to save the perms.
-- This does not elevate any permissions, so it is not a security issue.
Copy link
Member

Choose a reason for hiding this comment

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

Might be no harm to call this out in case adventurous folks are already playing around with this.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I added it in the PR description and the commit.

@EmyrkEmyrk changed the titlechore: implement typed database for custom permissionschore: implement typed database for custom permissions (breaks existing custom roles)Jun 4, 2024
@EmyrkEmyrk merged commite320661 intomainJun 4, 2024
36 checks passed
@EmyrkEmyrk deleted the stevenmasley/custom_roles_dbtype branchJune 4, 2024 14:27
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJun 4, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@EmyrkEmyrk

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@Emyrk@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp