DBSHARINGLinkPermissions

Objective-C

@interface DBSHARINGLinkPermissions : NSObject <DBSerializable, NSCopying>

Swift

class DBSHARINGLinkPermissions : NSObject, DBSerializable, NSCopying

The LinkPermissions struct.

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 current visibility of the link after considering the shared links policies of the the team (in case the link’s owner is part of a team) and the shared folder (in case the linked file is part of a shared folder). This field is shown only if the caller has access to this info (the link’s owner always has access to this data). For some links, an effective_audience value is returned instead.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) DBSHARINGResolvedVisibility *resolvedVisibility;

    Swift

    var resolvedVisibility: DBSHARINGResolvedVisibility? { get }
  • The shared link’s requested visibility. This can be overridden by the team and shared folder policies. The final visibility, after considering these policies, can be found in resolvedVisibility. This is shown only if the caller is the link’s owner and resolved_visibility is returned instead of effective_audience.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) DBSHARINGRequestedVisibility *requestedVisibility;

    Swift

    var requestedVisibility: DBSHARINGRequestedVisibility? { get }
  • Whether the caller can revoke the shared link.

    Declaration

    Objective-C

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

    Swift

    var canRevoke: NSNumber { get }
  • The failure reason for revoking the link. This field will only be present if the canRevoke is false.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) DBSHARINGSharedLinkAccessFailureReason *revokeFailureReason;

    Swift

    var revokeFailureReason: DBSHARINGSharedLinkAccessFailureReason? { get }
  • The type of audience who can benefit from the access level specified by the link_access_level field.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) DBSHARINGLinkAudience *effectiveAudience;

    Swift

    var effectiveAudience: DBSHARINGLinkAudience? { get }
  • The access level that the link will grant to its users. A link can grant additional rights to a user beyond their current access level. For example, if a user was invited as a viewer to a file, and then opens a link with link_access_level set to editor, then they will gain editor privileges. The link_access_level is a property of the link, and does not depend on who is calling this API. In particular, link_access_level does not take into account the API caller’s current permissions to the content.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) DBSHARINGLinkAccessLevel *linkAccessLevel;

    Swift

    var linkAccessLevel: DBSHARINGLinkAccessLevel? { get }

Constructors

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

    Declaration

    Objective-C

    - (nonnull instancetype)
          initWithCanRevoke:(nonnull NSNumber *)canRevoke
         resolvedVisibility:
             (nullable DBSHARINGResolvedVisibility *)resolvedVisibility
        requestedVisibility:
            (nullable DBSHARINGRequestedVisibility *)requestedVisibility
        revokeFailureReason:
            (nullable DBSHARINGSharedLinkAccessFailureReason *)revokeFailureReason
          effectiveAudience:(nullable DBSHARINGLinkAudience *)effectiveAudience
            linkAccessLevel:(nullable DBSHARINGLinkAccessLevel *)linkAccessLevel;

    Swift

    init(canRevoke: NSNumber, resolvedVisibility: DBSHARINGResolvedVisibility?, requestedVisibility: DBSHARINGRequestedVisibility?, revokeFailureReason: DBSHARINGSharedLinkAccessFailureReason?, effectiveAudience: DBSHARINGLinkAudience?, linkAccessLevel: DBSHARINGLinkAccessLevel?)

    Parameters

    canRevoke

    Whether the caller can revoke the shared link.

    resolvedVisibility

    The current visibility of the link after considering the shared links policies of the the team (in case the link’s owner is part of a team) and the shared folder (in case the linked file is part of a shared folder). This field is shown only if the caller has access to this info (the link’s owner always has access to this data). For some links, an effective_audience value is returned instead.

    requestedVisibility

    The shared link’s requested visibility. This can be overridden by the team and shared folder policies. The final visibility, after considering these policies, can be found in resolvedVisibility. This is shown only if the caller is the link’s owner and resolved_visibility is returned instead of effective_audience.

    revokeFailureReason

    The failure reason for revoking the link. This field will only be present if the canRevoke is false.

    effectiveAudience

    The type of audience who can benefit from the access level specified by the link_access_level field.

    linkAccessLevel

    The access level that the link will grant to its users. A link can grant additional rights to a user beyond their current access level. For example, if a user was invited as a viewer to a file, and then opens a link with link_access_level set to editor, then they will gain editor privileges. The link_access_level is a property of the link, and does not depend on who is calling this API. In particular, link_access_level does not take into account the API caller’s current permissions to the content.

    Return Value

    An initialized instance.

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

    Declaration

    Objective-C

    - (nonnull instancetype)initWithCanRevoke:(nonnull NSNumber *)canRevoke;

    Swift

    init(canRevoke: NSNumber)

    Parameters

    canRevoke

    Whether the caller can revoke the shared link.

    Return Value

    An initialized instance.