feat: add new workspace:share action type (#20198)

Closes
[coder/internal#1012](https://github.com/coder/internal/issues/1012)
This commit is contained in:
Brett Kolodny
2025-10-20 18:28:10 -04:00
committed by GitHub
parent 66f1603f6a
commit b022ccefa7
18 changed files with 101 additions and 10 deletions
+7 -1
View File
@@ -211,6 +211,8 @@ const (
ApiKeyScopeTaskUpdate APIKeyScope = "task:update"
ApiKeyScopeTaskDelete APIKeyScope = "task:delete"
ApiKeyScopeTask APIKeyScope = "task:*"
ApiKeyScopeWorkspaceShare APIKeyScope = "workspace:share"
ApiKeyScopeWorkspaceDormantShare APIKeyScope = "workspace_dormant:share"
)
func (e *APIKeyScope) Scan(src interface{}) error {
@@ -441,7 +443,9 @@ func (e APIKeyScope) Valid() bool {
ApiKeyScopeTaskRead,
ApiKeyScopeTaskUpdate,
ApiKeyScopeTaskDelete,
ApiKeyScopeTask:
ApiKeyScopeTask,
ApiKeyScopeWorkspaceShare,
ApiKeyScopeWorkspaceDormantShare:
return true
}
return false
@@ -641,6 +645,8 @@ func AllAPIKeyScopeValues() []APIKeyScope {
ApiKeyScopeTaskUpdate,
ApiKeyScopeTaskDelete,
ApiKeyScopeTask,
ApiKeyScopeWorkspaceShare,
ApiKeyScopeWorkspaceDormantShare,
}
}