Inherits from NSObject
Declared in KiiACL.h

Overview

A reference to the ACL of a KiiObject

A single KiiACL object can contain multiple KiiACLEntry objects, which grant/prevent access of the associated object to users and groups.

Instance Methods

listACLEntries:withCallback:

Asynchronously gets the list of active ACLs associated with this object from the server

- (void)listACLEntries:(id)delegate withCallback:(SEL)callback

Parameters

delegate

The object to make any callback requests to

callback

The callback method to be called when the request is completed. The callback method should have a signature similar to:

 - (void) listRetrieved:(KiiACL*)forACL withResults:(NSArray*)aclList andError:(NSError*)error {

     // the request was successful
     if(error == nil) {
         // do something with the list
     }

     else {
         // there was a problem
     }
 }

Discussion

Asynchronously gets the list of active ACLs associated with this object from the server

This is a non-blocking method

Declared In

KiiACL.h

listACLEntriesSynchronous:

Get the list of active ACLs associated with this object from the server

- (nullable NSArray *)listACLEntriesSynchronous:(NSError *_Nullable *_Nullable)error

Parameters

error

used to return an error by reference (pass NULL if this is not desired). It is recommended to set an actual error object to get the error information.

Return Value

An array of KiiACLEntry objects

Discussion

Get the list of active ACLs associated with this object from the server

This is a blocking method

Declared In

KiiACL.h

listACLEntriesWithBlock:

Asynchronously gets the list of active ACLs associated with this object from the server

- (void)listACLEntriesWithBlock:(KiiACLArrayBlock)block

Parameters

block

The block to be called upon method completion. See example

Discussion

Asynchronously gets the list of active ACLs associated with this object from the server

This is a non-blocking method

 [a listACLEntriesWithBlock:^(KiiACL *acl, NSArray *aclList, NSError *error) {
     if(error == nil) {
         NSLog(@"Got acl entries: %@", aclList);
     }
 }];

Declared In

KiiACL.h

putACLEntry:

Add a KiiACLEntry to the local object, if not already present

- (BOOL)putACLEntry:(nullable KiiACLEntry *)entry

Parameters

entry

The KiiACLEntry to add

Return Value

TRUE if the entry was added, FALSE otherwise

Discussion

Add a KiiACLEntry to the local object, if not already present

Declared In

KiiACL.h

removeACLEntry:

Remove a KiiACLEntry from the local object

- (BOOL)removeACLEntry:(nullable KiiACLEntry *)entry

Parameters

entry

The KiiACLEntry to remove

Return Value

TRUE if the entry was removed, FALSE otherwise

Discussion

Remove a KiiACLEntry from the local object

Declared In

KiiACL.h

save:withCallback:

Asynchronously saves the list of ACLEntry objects associated with this ACL object to the server

- (void)save:(id)delegate withCallback:(SEL)callback

Parameters

delegate

The object to make any callback requests to

callback

The callback method to be called when the request is completed. The callback method should have a signature similar to:

 - (void) aclSaved:(KiiACL*)acl withError:(NSError*)error andSuccessfulEntries:(NSArray*)successful andFailedEntries:(NSArray*)failed {

     // the request was successful
     if(error == nil) {
         // do something with the list
     }

     else {
         // there was a problem
     }
 }

Discussion

Asynchronously saves the list of ACLEntry objects associated with this ACL object to the server

This is a non-blocking method

Note: Subscribe or send message to topic is not supported for KiiAnonymousUser. Saving KiiACLEntry created with KiiAnonymousUser and KiiACLTopicActionSubscribe or KiiACLTopicActionSend will be failed with error code 514.

Declared In

KiiACL.h

saveSynchronous:didFail:error:

Save the list of ACLEntry objects associated with this ACL object to the server

- (BOOL)saveSynchronous:(NSArray *_Nullable *_Nullable)succeeded didFail:(NSArray *_Nullable *_Nullable)failed error:(NSError *_Nullable *_Nullable)error

Parameters

succeeded

An NSArray object of KiiACLEntry objects that were successfully updated

failed

An NSArray object of KiiACLEntry objects that failed to update.

error

used to return an error by reference (pass NULL if this is not desired). It is recommended to set an actual error object to get the error information. If this error shows partial success, one or more of the ACL entries was unsuccessfully saved - check the succeeded/failed parameters.

Return Value

YES if succeeded, NO otherwise.

Discussion

Save the list of ACLEntry objects associated with this ACL object to the server

This is a blocking method

Note: Subscribe or send message to topic is not supported for KiiAnonymousUser. Saving KiiACLEntry created with KiiAnonymousUser and KiiACLTopicActionSubscribe or KiiACLTopicActionSend will be failed with error code 514.

Declared In

KiiACL.h

saveSynchronous:didSucceed:didFail:

This method is deprecated. Use [KiiACL saveSynchronous:didFail:error:] (Deprecated: This method is deprecated. Use [KiiACL saveSynchronous:didFail:error:])

- (BOOL)saveSynchronous:(NSError *_Nullable *_Nullable)error didSucceed:(NSArray *_Nullable *_Nullable)succeeded didFail:(NSArray *_Nullable *_Nullable)failed

Declared In

KiiACL.h

saveWithBlock:

Asynchronously saves the list of ACLEntry objects associated with this ACL object to the server.

- (void)saveWithBlock:(KiiACLSaveBlock)block

Parameters

block

The block to be called upon method completion. See example

Discussion

Asynchronously saves the list of ACLEntry objects associated with this ACL object to the server.

This is a non-blocking method

 [a listACLEntriesWithBlock:^(KiiACL *acl, NSArray *succeeded, NSArray *failed, NSError *error) {
     if(error == nil) {
         NSLog(@"ACL entries that were successfully saved: %@", succeeded);
         NSLog(@"ACL entries that were NOT saved: %@", failed);
     }
 }];

Note: Subscribe or send message to topic is not supported for KiiAnonymousUser. Saving KiiACLEntry created with KiiAnonymousUser and KiiACLTopicActionSubscribe or KiiACLTopicActionSend will be failed with error code 514.

Declared In

KiiACL.h