chore: Rename 'admin' to 'owner' (#3498)

Co-authored-by: Colin Adler <colin1adler@gmail.com>
This commit is contained in:
Steven Masley
2022-08-15 14:40:19 -05:00
committed by GitHub
parent 2306d2c709
commit 01dd35f1ba
16 changed files with 98 additions and 56 deletions

View File

@ -9,7 +9,7 @@ import (
)
const (
admin string = "admin"
owner string = "owner"
member string = "member"
templateAdmin string = "template-admin"
userAdmin string = "user-admin"
@ -24,8 +24,8 @@ const (
// Once we have a database implementation, the "default" roles can be defined on the
// site and orgs, and these functions can be removed.
func RoleAdmin() string {
return roleName(admin, "")
func RoleOwner() string {
return roleName(owner, "")
}
func RoleTemplateAdmin() string {
@ -59,10 +59,10 @@ var (
// https://github.com/coder/coder/issues/1194
builtInRoles = map[string]func(orgID string) Role{
// admin grants all actions to all resources.
admin: func(_ string) Role {
owner: func(_ string) Role {
return Role{
Name: admin,
DisplayName: "Admin",
Name: owner,
DisplayName: "Owner",
Site: permissions(map[Object][]Action{
ResourceWildcard: {WildcardSymbol},
}),
@ -187,8 +187,8 @@ var (
// The first key is the actor role, the second is the roles they can assign.
// map[actor_role][assign_role]<can_assign>
assignRoles = map[string]map[string]bool{
admin: {
admin: true,
owner: {
owner: true,
auditor: true,
member: true,
orgAdmin: true,