seafile-web-api-2.1

Sub Folder Permissions

Folder Permissions is for Fine-grained Access Control.

Get User Folder Permission

GET https://cloud.seafile.com/api2/repos/{repo_id}/user-folder-perm/?folder_path=/123

Request parameters

Sample request

curl -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api2/repos/bdf816e6-aba8-468c-962f-77c2fcfd1d1c/user-folder-perm/?folder_path=/123"

Sample response

    [
        {
        "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
        "folder_path": "/123",
        "permission": "r",
        "folder_name": "123",
        "user_name": "1",
        "user_email": "1@1.com"
    },
    {
        "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
        "folder_path": "/123",
        "permission": "rw",
        "folder_name": "123",
        "user_name": "2",
        "user_email": "2@1.com"
    }
]

Errors

Set User Folder Permission

POST https://cloud.seafile.com/api2/repos/{repo_id}/user-folder-perm/

Request parameters

Sample request

curl -d "folder_path=/123&permission=rw&user_email=3@1.com&user_email=2@1.com" -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api2/repos/bdf816e6-aba8-468c-962f-77c2fcfd1d1c/user-folder-perm/"

Sample response

{
    "failed": [
        {
            "error_msg": "Permission already exists.",
            "user_email": "2@1.com"
        }
    ],
    "success": [
        {
            "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
            "folder_path": "/123",
            "permission": "rw",
            "folder_name": "123",
            "user_name": "3",
            "user_email": "3@1.com"
        }
    ]
}

Errors

Modify User Folder Permission

PUT https://cloud.seafile.com/api2/repos/{repo_id}/user-folder-perm/

Request parameters

Sample request

curl -X PUT -d "folder_path=/123&permission=r&user_email=3@1.com" -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api2/repos/bdf816e6-aba8-468c-962f-77c2fcfd1d1c/user-folder-perm/"

Sample response

{
    "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
    "folder_path": "/123",
    "permission": "r",
    "folder_name": "123",
    "user_name": "3",
    "user_email": "3@1.com"
}

Errors

Delete User Folder Permission

DELETE https://cloud.seafile.com/api2/repos/{repo_id}/user-folder-perm/

Request parameters

Sample request

curl -X DELETE -d "folder_path=/123&user_email=3@1.com" -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api2/repos/bdf816e6-aba8-468c-962f-77c2fcfd1d1c/user-folder-perm/"

Sample response

{
    "success": true
}

Errors

Get Group Folder Permission

GET https://cloud.seafile.com/api2/repos/{repo_id}/group-folder-perm/?folder_path=/123

Request parameters

Sample request

curl -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api2/repos/bdf816e6-aba8-468c-962f-77c2fcfd1d1c/group-folder-perm/?folder_path=/123"

Sample response

[
    {
        "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
        "folder_path": "/123",
        "permission": "rw",
        "group_name": "group-2-of-lian",
        "folder_name": "123",
        "group_id": 586
    },
    {
        "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
        "folder_path": "/123",
        "permission": "r",
        "group_name": "group-of-lian",
        "folder_name": "123",
        "group_id": 65
    }
]

Errors

Set Group Folder Permission

POST https://cloud.seafile.com/api2/repos/{repo_id}/group-folder-perm/

Request parameters

Sample request

curl -d "folder_path=/123&permission=rw&group_id=586&group_id=65" -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api2/repos/bdf816e6-aba8-468c-962f-77c2fcfd1d1c/group-folder-perm/"

Sample response

{
    "failed": [
        {
            "group_id": 65,
            "error_msg": "Permission already exists."
        }
    ],
    "success": [
        {
            "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
            "folder_path": "/123",
            "permission": "rw",
            "group_name": "group-2-of-lian",
            "folder_name": "123",
            "group_id": 586
        }
    ]
}

Errors

Modify Group Folder Permission

PUT https://cloud.seafile.com/api2/repos/{repo_id}/group-folder-perm/

Request parameters

Sample request

curl -X PUT -d "folder_path=/123&permission=rw&group_id=65" -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api2/repos/bdf816e6-aba8-468c-962f-77c2fcfd1d1c/group-folder-perm/"

Sample response

{
    "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
    "folder_path": "/123",
    "permission": "rw",
    "group_name": "group-of-lian",
    "folder_name": "123",
    "group_id": 65
}

Errors

Delete Group Folder Permission

DELETE https://cloud.seafile.com/api2/repos/{repo_id}/group-folder-perm/

Request parameters

Sample request

curl -X DELETE -d "folder_path=/123&group_id=65" -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api2/repos/bdf816e6-aba8-468c-962f-77c2fcfd1d1c/group-folder-perm/"

Sample response

{
    "success": true
}

Errors