Permissions

A Permission object represents a grant of access permission on a specific Path to a User or Group.

They can be optionally recursive or nonrecursive into the subfolders of that path.

A Permission may be applied to a User or a Group, but not both at once.

The following table sets forth the available Permission types:

PermissionAccess Level GrantedAutomatically Also Includes/Implies Permissions
adminAble to manage Folder Behaviors, Permissions, and Notifications for the folder. Also grants all other permissions.bundle, full, writeonly, readonly, list, history
bundleAble to share files and folders via a Bundle (share link).readonly, list
fullAble to read, write, move, delete, and rename files and folders. Also grants the ability to overwrite files upon upload.writeonly, readonly, list
historyAble to view the history of files and folders and to create email notifications for themselves.list
listAble to list files and folders, but not download.none
readonlyAble to list, preview, and download files and folders.list
readonly_site_adminAble to behave as a read-only Site Admin on a given child site. Only applies to child sites.readonly, list, history
site_adminAble to behave as a Site Admin on a given child site. Only applies to child sites.bundle, full, writeonly, readonly, list, history
writeonlyAble to upload files, create folders and list subfolders the user has write permission to.none

Resource Schema

Required

PropertyDescription
path
String
Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.

Optional

PropertyDescription
user_id
Int64
User ID
username
String
Username (if applicable)
group_id
Int64
Group ID
group_name
String
Group name (if applicable)
group_ids
List
Group IDs when this permission requires multiple groups
partner_id
Int64
Partner ID (if applicable)
permission
String
Permission type. See the table referenced in the documentation for an explanation of each permission.
Possible values: full, readonly, writeonly, list, history, admin, bundle, site_admin, readonly_site_admin, previewonly
recursive
Bool
Recursive: does this permission apply to subfolders?
site_id
Int64
Site ID

Read Only

PropertyDescription
id
Int64
Permission ID
group_names
List
Group names when this permission requires multiple groups
partner_name
String
Partner name (if applicable)

Example Resource

resource "files_permission" "example_permission" {
  path       = "path"
  group_id   = 1
  group_ids  = [1]
  permission = "full"
  recursive  = false
  partner_id = 1
  user_id    = 1
  username   = "user"
  group_name = "example"
  site_id    = 1
}

Resource Import

This Resource supports importing using the following syntax:

Example Import Command

# Permissions can be imported by specifying the id.
terraform import files_permission.example_permission 1

Data Source Schema

Required

PropertyDescription
id
Int64
Permission ID

Read Only

PropertyDescription
path
String
Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
user_id
Int64
User ID
username
String
Username (if applicable)
group_id
Int64
Group ID
group_name
String
Group name (if applicable)
group_ids
List
Group IDs when this permission requires multiple groups
group_names
List
Group names when this permission requires multiple groups
partner_id
Int64
Partner ID (if applicable)
partner_name
String
Partner name (if applicable)
permission
String
Permission type. See the table referenced in the documentation for an explanation of each permission.
Possible values: full, readonly, writeonly, list, history, admin, bundle, site_admin, readonly_site_admin, previewonly
recursive
Bool
Recursive: does this permission apply to subfolders?
site_id
Int64
Site ID

Example Data Source

data "files_permission" "example_permission" {
  id = 1
}