dokploy_user_permissions (Resource)
The permissions of one member of the active organization: what a user with the member role can see and do. An admin or the owner has every permission, and Dokploy ignores these flags for them.
~> Destroying this resource resets every permission to the Dokploy default: no access. The user account stays.
~> The API key’s user must be the owner of the organization; Dokploy refuses the call otherwise.
Example Usage
# Permissions of a member that was invited in the Dokploy UI. The lookup by
# email gives the user id.
data "dokploy_user" "contractor" {
email = "[email protected]"
}
resource "dokploy_user_permissions" "contractor" {
user_id = data.dokploy_user.contractor.id
accessed_projects = [dokploy_project.app.id]
accessed_environments = [dokploy_environment.staging.id]
can_create_services = true
can_delete_services = false
can_access_docker = true
}Schema
Required
user_id(String) Id of the user:dokploy_user.id, or theidof thedokploy_userdata source for a user that was invited in the UI.
Optional
accessed_environments(Set of String) Ids of the environments that the user can open. Defaults to an empty set.accessed_git_providers(Set of String) Ids of the git providers that the user can use. Defaults to an empty set.accessed_projects(Set of String) Ids of the projects that the user can open. Defaults to an empty set.accessed_servers(Set of String) Ids of the remote servers that the user can use. Defaults to an empty set.accessed_services(Set of String) Ids of the services (applications, composes, databases) that the user can open. Defaults to an empty set.can_access_api(Boolean) Let the user generate API keys and read the API docs. Defaults tofalse.can_access_docker(Boolean) Let the user open the Docker container views. Defaults tofalse.can_access_git_providers(Boolean) Let the user manage git providers. Defaults tofalse.can_access_ssh_keys(Boolean) Let the user manage SSH keys. Defaults tofalse.can_access_traefik_files(Boolean) Let the user edit the Traefik configuration files. Defaults tofalse.can_create_environments(Boolean) Let the user create environments. Defaults tofalse.can_create_projects(Boolean) Let the user create projects. Defaults tofalse.can_create_services(Boolean) Let the user create services. Defaults tofalse.can_delete_environments(Boolean) Let the user delete environments. Defaults tofalse.can_delete_projects(Boolean) Let the user delete projects. Defaults tofalse.can_delete_services(Boolean) Let the user delete services. Defaults tofalse.
Read-Only
id(String) Same asuser_id.member_id(String) Id of the membership record.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
# Import by the user id.
terraform import dokploy_user_permissions.contractor rM64isnUKMgqgOnwm7zE3