ZDCSharePermission

enum ZDCSharePermission {}

Permissions are represented as a string, where each character in the string has a special meaning.

  • Read permission for the user. If a user has this flag, the server assumes the user knows how to decrypt the content, and will send push notifications to the user when the file is uploaded, modified or deleted.

    If the node has children, the read permission also means the user is allowed to list the children. By default, only the owner of a bucket is allowed to list items within that bucket. All other users must be given read permission for each node in which they’re allowed to list the direct children.

    Declaration

    Objective-C

    ZDCSharePermission_Read = 'r'

    Swift

    static var read: ZDCSharePermission { get }
  • Write permission for the user. If the user has this flag, they are are allowed to modify the content of the node. Keep in mind that this permission (by itself) does not allow the user to modify the permissions set of a node - only the content.

    If the node has children, the write permission also means the user is allowed to delete children.

    Declaration

    Objective-C

    ZDCSharePermission_Write = 'w'

    Swift

    static var write: ZDCSharePermission { get }
  • The share permission means the user is allowed to modify the node’s set of permissions. This means they can add someone to the list, remove someone, or even modify existing permissions. However, the bucket owner’s permissions can never be modified. That is, if the node exists in Alice’s bucket, and Bob has share permission on the node, Bob cannot remove Alice from the list of permissions, nor can he modify her permissions.

    Declaration

    Objective-C

    ZDCSharePermission_Share = 's'

    Swift

    static var share: ZDCSharePermission { get }
  • All children of the node are restricted to RCRD files - DATA files are not allowed. Keep in mind that the server always restricts the size of RCRD files to 1 MiB.

    By default, ZeroDark.cloud supports nodes of all sizes - everything from a few bytes, up to multi-gigabyte files. Using this permission can be thought of as a way of preventing abuse. For examle, a user’s ‘msgs’ container uses this flag.

    Declaration

    Objective-C

    ZDCSharePermission_RecordsOnly = 'R'

    Swift

    static var recordsOnly: ZDCSharePermission { get }
  • All children of the node are restricted to leafs. That is, the children cannot have their own children. Using this permission is another way of preventing abuse. A user’s ‘inbox’ & ‘msgs’ folders use this permission.

    Declaration

    Objective-C

    ZDCSharePermission_LeafsOnly = 'L'

    Swift

    static var leafsOnly: ZDCSharePermission { get }
  • Users with this permission are allowed to create/modify a single child node, whose name matches their userID. For example, if Alice’s userID is ‘z55tqmfr9kix1p1gntotqpwkacpuoyno’, then she will be allowed to create/modify a file called ‘z55tqmfr9kix1p1gntotqpwkacpuoyno.{ext}’.

    Declaration

    Objective-C

    ZDCSharePermission_UserOnly = 'U'

    Swift

    static var userOnly: ZDCSharePermission { get }
  • Users with this permission are allowed to create child nodes. However, the nodes are considered write once, in that the user can create them, but doesn’t have permission to modify them afterwards.

    A user’s inbox utilizes this flag. For example, Alice is allowed to write a message into Bob’s inbox trunk, but Alice doesn’t have permission to modify that message afterwards.

    See

    ZDCSharePermission_BurnIfSender

    Declaration

    Objective-C

    ZDCSharePermission_WriteOnce = 'W'

    Swift

    static var writeOnce: ZDCSharePermission { get }
  • The node can be deleted by the sender. In other words, the sender doesn’t require ‘w’ permission on the parent node, just the ‘B’ permission on the node to be deleted.

    Declaration

    Objective-C

    ZDCSharePermission_BurnIfSender = 'B'

    Swift

    static var burnIfSender: ZDCSharePermission { get }