Instance Property

availablePermissions

A combination of permission and access options made available to the user when viewing screens presented by the CloudKit sharing controller.

Declaration

@property(nonatomic) UICloudSharingPermissionOptions availablePermissions;

Discussion

The UICloudSharingController user interface displays permission options to the user. The user selects the options based on how the data should be shared. For instance, the user can decide to share the data publicly or privately by selecting the corresponding option.

Setting the availablePermissions property on UICloudSharingController to one or more UICloudSharingPermissionOptions options tells the controller which options to present to the user. If you want, for example, to let the user decide whether to share the data publicly or privately, you specify the UICloudSharingPermissionAllowPublic and UICloudSharingPermissionAllowPrivate options for availablePermissions. This tells the controller to display both options to the user.

Specifying no options for availablePermissions tells UICloudSharingController to display all options to the user.

Listing 1

Allow only invited participants and read/write permission options.

// Allow only the invited participants and read/write permission options.
[cloudSharingController setAvailablePermissions:UICloudSharingPermissionAllowPrivate | UICloudSharingPermissionAllowReadWrite];

Display Groupings

The UICloudSharingController displays the permission options to the user based on the options set in the availablePermissions property. The user interface displays the options in two groups, access options group and permission options group. The UICloudSharingPermissionAllowPublic and UICloudSharingPermissionAllowPrivate options control the display of the access options group, while the UICloudSharingPermissionAllowReadOnly and UICloudSharingPermissionAllowReadWrite options control the display of the permission options group.

Complementary Options

The UICloudSharingPermissionAllowPrivate and UICloudSharingPermissionAllowPublic options are complementary. If you exclude one, the access options group is omitted from the UICloudSharingController user interface, and the share access setting defaults to the included option. This prevents the user from changing the access rights to the share. For instance, to always force a private share, you would include the UICloudSharingPermissionAllowPrivate access option while excluding UICloudSharingPermissionAllowPublic when setting the availablePermissions property. The controller sets the share's access rights to private and removes the access options group from the user interface, preventing the user from changing the setting.

Similarly, UICloudSharingPermissionAllowReadOnly and UICloudSharingPermissionAllowReadWrite complement each other. Excluding one removes the permission options group from the user interface, and the share permission setting defaults to the included UICloudSharingPermissionOptions option.

See Also

Configuring the Permissions

UICloudSharingPermissionOptions

A set of options that determine the permission options available to the user when viewing the Cloud sharing controller screens.