Advanced File Permissions

Updated: 2017-11-9

API Domain

Host: app.fileshow.com

Note: The secret used for library file operations API is org_client_secret obtained after Library Authorization.


Set Permissions

POST /m-open/2/file/set_permission HTTP/1.1

Request Parameters

Name Required Description
org_client_id Yes Library authorization client_id
fullpath Yes Full path of the file
permissions Yes Format as described below
dateline Yes Current UNIX timestamp in seconds
sign Yes Signature

Permissions format:

{
    "group_ids": [
        Department ID (int),
        ...
    ],
    "group_out_ids": [
        Department unique ID in external system (string),
        ...
    ],
    "member_ids": [
        Member ID (int),
        ...
    ],
    "accounts": [
        Member login account (string),
        ...
    ],
    "out_ids": [
        Member unique ID in external system (string),
        ...
    ],
    "permission": {
        "role_id": Role ID (int), // Use 0 for custom permissions
        "ls": Permission status (int),
        ...
    }
}

Key Explanation

  • group_ids: Use department ID when setting department permissions.
  • group_out_ids: Use unique department ID in the external system when setting department permissions.
  • member_ids: Use member ID when setting member permissions.
  • accounts: Use member login account when setting member permissions.
  • out_ids: Use member unique ID in external system when setting member permissions.
  • permission: Specify the permissions to set.

Note: Use either group_ids or group_out_ids, and either member_ids, accounts, or out_ids.

Permission Status

  • 1: Grant this permission.
  • -1: Deny this permission.
  • 0: No specific setting for this permission (optional).

Response

HTTP 200


Set Permission Inheritance

POST /m-open/2/file/set_permission_inherit HTTP/1.1

Request Parameters

Name Required Description
org_client_id Yes Library authorization client_id
fullpath Yes Full path of the file
inherit Yes Enable permission inheritance: 1 for yes, 0 for no
keep Yes Preserve and merge parent permissions: 1 for yes, 0 for no
dateline Yes Current UNIX timestamp in seconds
sign Yes Signature

Response

HTTP 200


Batch Set Permissions

POST /m-open/2/file/batch_set_permission HTTP/1.1

Request Parameters

Name Required Description
org_client_id Yes Library authorization client_id
fullpaths Yes Full paths of files, separated by vertical bar ` `
type Yes Batch setting mode: 0 for add permissions, 1 to set permissions (clears existing permissions)
inherit No Enable permission inheritance: 1 for yes, 0 for no
permissions Yes Format as described below
dateline Yes Current UNIX timestamp in seconds
sign Yes Signature

Permissions format:

{
    "group_ids": [
        Department ID (int),
        ...
    ],
    "group_out_ids": [
        Department unique ID in external system (string),
        ...
    ],
    "member_ids": [
        Member ID (int),
        ...
    ],
    "accounts": [
        Member login account (string),
        ...
    ],
    "out_ids": [
        Member unique ID in external system (string),
        ...
    ],
    "permission": {
        "role_id": Role ID (int), // Use 0 for custom permissions
        "ls": Permission status (int),
        ...
    }
}

Response

HTTP 200


Delete Permissions

POST /m-open/2/file/del_permission HTTP/1.1

Request Parameters

Name Required Description
org_client_id Yes Library authorization client_id
fullpath Yes Full path of the file
ids Yes Format as described below
dateline Yes Current UNIX timestamp in seconds
sign Yes Signature

ids format:

{
    "group_ids": [
        Department ID (int),
        ...
    ],
    "group_out_ids": [
        Department unique ID in external system (string),
        ...
    ],
    "member_ids": [
        Member ID (int),
        ...
    ],
    "accounts": [
        Member login account (string),
        ...
    ],
    "out_ids": [
        Member unique ID in external system (string),
        ...
    ]
}

Response

HTTP 200


Get Member Permissions

POST /m-open/2/file/get_member_permission HTTP/1.1

Request Parameters

Name Required Description
org_client_id Yes Library authorization client_id
fullpath Yes Full path of the file
member_id - Member ID
out_id - Member unique ID in external system
account - Member login account in external system
dateline Yes Current UNIX timestamp in seconds
sign Yes Signature

Note: Provide one of member_id, out_id, or account in the parameters.

Response

{
    "ss": Permission value (int),
    ...
}

Get Group Permissions

POST /m-open/2/file/get_group_permission HTTP/1.1

Request Parameters

Name Required Description
org_client_id Yes Library authorization client_id
fullpath Yes Full path of the file
group_id - Department ID
group_out_id - Department unique ID in external system
dateline Yes Current UNIX timestamp in seconds
sign Yes Signature

Note: Provide either group_id or group_out_id in the parameters.

Response

{
    "ss": Permission value (int),
    ...
}

Permission Reference Table

Permission Description
ls View
cd Enter directory
pv Preview file
dl Download/open file
w Write/edit file
ul Add new file
mk Create new folder
ren Rename
rm Delete
ln Share via external link
h View version history
hr Restore version
rmk View comments / @ mentions
rmka Add comments / @ mentions
t Add tags
trm Delete tags
p View shared participants
ps Manage shared participants
ss Display current item
sren Rename current item
srm Delete current item
mls Modify library settings
b View recycle bin files
br Restore recycle bin files
be Delete/clear recycle bin files
mln Manage library file/folder external links