mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add new workspace:share action type (#20198)
Closes [coder/internal#1012](https://github.com/coder/internal/issues/1012)
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user