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

Commitb76f373

Browse files
committed
Add some comments
1 parentdb04d67 commitb76f373

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

‎coderd/httpmw/authorize.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func Authorize(logger slog.Logger, auth *rbac.RegoAuthorizer, action rbac.Action
2020
returnfunc(next http.Handler) http.Handler {
2121
returnhttp.HandlerFunc(func(rw http.ResponseWriter,r*http.Request) {
2222
roles:=UserRoles(r)
23-
object:=authObject(r)
23+
object:=rbacObject(r)
2424

2525
ifobject.Type=="" {
2626
panic("developer error: auth object has no type")
@@ -72,7 +72,7 @@ func Authorize(logger slog.Logger, auth *rbac.RegoAuthorizer, action rbac.Action
7272
typeauthObjectKeystruct{}
7373

7474
// APIKey returns the API key from the ExtractAPIKey handler.
75-
funcauthObject(r*http.Request) rbac.Object {
75+
funcrbacObject(r*http.Request) rbac.Object {
7676
obj,ok:=r.Context().Value(authObjectKey{}).(rbac.Object)
7777
if!ok {
7878
panic("developer error: auth object middleware not provided")

‎coderd/rbac/builtin.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,11 @@ func IsOrgRole(roleName string) (string, bool) {
146146
}
147147

148148
// OrganizationRoles lists all roles that can be applied to an organization user
149-
// in the given organization.
149+
// in the given organization. This is the list of available roles,
150+
// and specific to an organization.
151+
//
150152
// This should be a list in a database, but until then we build
151-
//the list from the builtins.
153+
// the list from the builtins.
152154
funcOrganizationRoles(organizationID uuid.UUID) []string {
153155
varroles []string
154156
for_,roleF:=rangebuiltInRoles {
@@ -166,8 +168,10 @@ func OrganizationRoles(organizationID uuid.UUID) []string {
166168
}
167169

168170
// SiteRoles lists all roles that can be applied to a user.
171+
// This is the list of available roles, and not specific to a user
172+
//
169173
// This should be a list in a database, but until then we build
170-
//the list from the builtins.
174+
// the list from the builtins.
171175
funcSiteRoles() []string {
172176
varroles []string
173177
forrole:=rangebuiltInRoles {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp