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 api for creating custom roles#13298

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_role_api
May 16, 2024

Conversation

Emyrk
Copy link
Member

No description provided.

@EmyrkGraphite App
Copy link
MemberAuthor

Emyrk commentedMay 16, 2024
edited
Loading

@EmyrkEmyrkforce-pushed thestevenmasley/custom_role_functions branch fromba10185 toef8c950CompareMay 16, 2024 15:14
@EmyrkEmyrkforce-pushed thestevenmasley/custom_role_api branch fromad4023b toc1c3891CompareMay 16, 2024 15:14
Base automatically changed fromstevenmasley/custom_role_functions tostevenmasley/custom_site_dbMay 16, 2024 15:17
@EmyrkEmyrkforce-pushed thestevenmasley/custom_site_db branch from4060c07 toc58a6fdCompareMay 16, 2024 15:26
@EmyrkEmyrkforce-pushed thestevenmasley/custom_role_api branch fromc1c3891 toaf25ebbCompareMay 16, 2024 15:27
@EmyrkEmyrkforce-pushed thestevenmasley/custom_site_db branch fromc58a6fd to88ca559CompareMay 16, 2024 15:30
@EmyrkEmyrkforce-pushed thestevenmasley/custom_role_api branch fromaf25ebb to8abb57eCompareMay 16, 2024 15:30
@EmyrkEmyrkforce-pushed thestevenmasley/custom_site_db branch from88ca559 to96d1527CompareMay 16, 2024 15:44
@EmyrkEmyrkforce-pushed thestevenmasley/custom_role_api branch 3 times, most recently fromf1c61bd toe5613b2CompareMay 16, 2024 15:54

// UpsertCustomSiteRole will upsert a custom site wide role
func (c*Client)UpsertCustomSiteRole(ctx context.Context,reqRole) (Role,error) {
res,err:=c.Request(ctx,http.MethodPatch,"/api/v2/users/roles",req)
Copy link
Member

Choose a reason for hiding this comment

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

/api/v2/users/roles seems like a weird place to mount this 🤔

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yea? That is where the roles api currently is. Any suggestions?

Copy link
Member

@johnstcnjohnstcnMay 16, 2024
edited
Loading

Choose a reason for hiding this comment

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

Wouldn't they be org-scoped?

EDIT: Ah no, they can have user, org, and site perms.

Honestly I'd put them under a separate/api/v2/roles endpoint but I think that's definitely out of scope of this PR.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

These roles are site scoped.

There is a/roles under/organizations/{organization}/members/roles for org scoped roles.

@EmyrkEmyrkforce-pushed thestevenmasley/custom_role_api branch from4259691 toe0cdcddCompareMay 16, 2024 16:26
Comment on lines +63 to +72
// Verify the role exists in the list
// TODO: Turn this assertion back on when the cli api experience is created.
//allRoles, err := tmplAdmin.ListSiteRoles(ctx)
//require.NoError(t, err)
//
//require.True(t, slices.ContainsFunc(allRoles, func(selected codersdk.AssignableRoles) bool {
//return selected.Name == role.Name
//}), "role missing from site role list")
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

To prevent this PR from growing anymore, I am going to push this to the next PR. Essentially, from a UI perspective, our existing role endpoints do not fetch custom roles.

Since there is no UI or cli in this PR and this is already large, I am going to intentionally not solve this here (and this is gated behind an experiment).

johnstcn reacted with thumbs up emoji
@EmyrkEmyrkforce-pushed thestevenmasley/custom_site_db branch from96d1527 to992c845CompareMay 16, 2024 17:07
@EmyrkEmyrkforce-pushed thestevenmasley/custom_role_api branch from07d531d to28477baCompareMay 16, 2024 17:07
@EmyrkEmyrkforce-pushed thestevenmasley/custom_site_db branch from992c845 toa6996f6CompareMay 16, 2024 17:09
@EmyrkEmyrkforce-pushed thestevenmasley/custom_role_api branch 2 times, most recently from75e7bd8 to747fc79CompareMay 16, 2024 17:22
@EmyrkEmyrk requested a review fromjohnstcnMay 16, 2024 17:23
Base automatically changed fromstevenmasley/custom_site_db tomainMay 16, 2024 18:11
@EmyrkEmyrkforce-pushed thestevenmasley/custom_role_api branch from801e054 to68807acCompareMay 16, 2024 18:14
@EmyrkEmyrk merged commitad8c314 intomainMay 16, 2024
@EmyrkEmyrk deleted the stevenmasley/custom_role_api branchMay 16, 2024 18:47
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 16, 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