An organization's admin, and forms only for those who may send them
C1. A membership of an organization may be admin as well as member and manager. An admin sees /org as a manager does and changes the organization from it: its teams and projects, who of the approved accounts is in them, its members' roles, and the keys spent in its projects. Every id a form names is checked against the organization; limits, accounts, the organization's name and the cluster stay with the cluster's staff, and an admin cannot take their own role away. A group from OIDC, SCIM or a directory no longer rewrites a membership it names as a plain member at every sign-in, which took a manager's role away (EnsureMembership). Pages draw a form only for someone who may send it: Nav.May asks the staff rule staffMay keeps, and a page whose forms a person may not send gets no form token. A viewer sees the people, limits and mirror pages without forms; an operator the mirror's. Forms are compact: labels close to their fields, fields as wide as what goes in them, smaller buttons, and the short forms on one line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2cb1afda55
commit
102ca9556f
37 files changed
+1204
-212
No files matched your search
@@ -634,8 +634,12 @@ func (a *API) membership(add bool) http.HandlerFunc {
|
||||
if role == "" {
|
||||
role = store.RoleMember
|
||||
}
|
||||
if role != store.RoleMember && role != store.RoleManager {
|
||||
writeError(w, http.StatusBadRequest, fmt.Sprintf("role %q: member or manager", role))
|
||||
if role != store.RoleMember && role != store.RoleManager && role != store.RoleOrgAdmin {
|
||||
writeError(w, http.StatusBadRequest, fmt.Sprintf("role %q: member, manager or admin", role))
|
||||
return
|
||||
}
|
||||
if role != store.RoleMember && scope != store.ScopeOrg {
|
||||
writeError(w, http.StatusBadRequest, fmt.Sprintf("%s is a role on an organization", role))
|
||||
return
|
||||
}
|
||||
if err := a.tenancy.AddMembership(ctx, u.ID, scope, id, role, actorOf(r), time.Now()); err != nil {
|
||||
|
||||
Reference in new issue
Block a user