DBSHARINGFilePermission

Objective-C

@interface DBSHARINGFilePermission : NSObject <DBSerializable, NSCopying>

Swift

class DBSHARINGFilePermission : NSObject, DBSerializable, NSCopying

The FilePermission struct.

Whether the user is allowed to take the sharing action on the file.

This class implements the DBSerializable protocol (serialize and deserialize instance methods), which is required for all Obj-C SDK API route objects.

Instance fields

  • The action that the user may wish to take on the file.

    Declaration

    Objective-C

    @property (nonatomic, readonly) DBSHARINGFileAction *_Nonnull action;

    Swift

    var action: DBSHARINGFileAction { get }
  • True if the user is allowed to take the action.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSNumber *_Nonnull allow;

    Swift

    var allow: NSNumber { get }
  • The reason why the user is denied the permission. Not present if the action is allowed.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) DBSHARINGPermissionDeniedReason *reason;

    Swift

    var reason: DBSHARINGPermissionDeniedReason? { get }

Constructors

  • Full constructor for the struct (exposes all instance variables).

    Declaration

    Objective-C

    - (nonnull instancetype)
        initWithAction:(nonnull DBSHARINGFileAction *)action
                 allow:(nonnull NSNumber *)allow
                reason:(nullable DBSHARINGPermissionDeniedReason *)reason;

    Swift

    init(action: DBSHARINGFileAction, allow: NSNumber, reason: DBSHARINGPermissionDeniedReason?)

    Parameters

    action

    The action that the user may wish to take on the file.

    allow

    True if the user is allowed to take the action.

    reason

    The reason why the user is denied the permission. Not present if the action is allowed.

    Return Value

    An initialized instance.

  • Convenience constructor (exposes only non-nullable instance variables with no default value).

    Declaration

    Objective-C

    - (nonnull instancetype)initWithAction:(nonnull DBSHARINGFileAction *)action
                                     allow:(nonnull NSNumber *)allow;

    Swift

    init(action: DBSHARINGFileAction, allow: NSNumber)

    Parameters

    action

    The action that the user may wish to take on the file.

    allow

    True if the user is allowed to take the action.

    Return Value

    An initialized instance.