LuxChat  2.0
Instant messenger for iOS
Instance Methods | Class Methods | Properties | List of all members
PFACL Class Reference

#import <PFACL.h>

Inheritance diagram for PFACL:

Instance Methods

(void) - setReadAccess:forUserId:
 
More...
 
(BOOL) - getReadAccessForUserId:
 
(void) - setWriteAccess:forUserId:
 
(BOOL) - getWriteAccessForUserId:
 
(void) - setReadAccess:forUser:
 
(BOOL) - getReadAccessForUser:
 
(void) - setWriteAccess:forUser:
 
(BOOL) - getWriteAccessForUser:
 
(BOOL) - getReadAccessForRoleWithName:
 
More...
 
(void) - setReadAccess:forRoleWithName:
 
(BOOL) - getWriteAccessForRoleWithName:
 
(void) - setWriteAccess:forRoleWithName:
 
(BOOL) - getReadAccessForRole:
 
(void) - setReadAccess:forRole:
 
(BOOL) - getWriteAccessForRole:
 
(void) - setWriteAccess:forRole:
 

Class Methods

(instancetype) + ACL
 
More...
 
(instancetype) + ACLWithUser:
 
(void) + setDefaultACL:withAccessForCurrentUser:
 
More...
 

Properties

BOOL publicReadAccess
 
More...
 
BOOL publicWriteAccess
 

Detailed Description

The PFACL class is used to control which users can access or modify a particular object. Each PFObject can have its own PFACL. You can grant read and write permissions separately to specific users, to groups of users that belong to roles, or you can grant permissions to "the public" so that, for example, any user could read a particular object but only a particular set of users could write to that object.

Method Documentation

+ (instancetype) ACL



Creates an ACL with no permissions granted.

Returns
Returns a new PFACL.
+ (instancetype) ACLWithUser: (PFUser *)  user

Creates an ACL where only the provided user has access.

Parameters
userThe user to assign access.
- (BOOL) getReadAccessForRole: (PFRole *)  role

Get whether users belonging to the given role are allowed to read this object. Even if this returns NO, the role may still be able to read it if a parent role has read access.

The role must already be saved on the server and it's data must have been fetched in order to use this method.

Parameters
roleThe name of the role.
Returns
YES if the role has read access, otherwise NO.
- (BOOL) getReadAccessForRoleWithName: (NSString *)  name



Get whether users belonging to the role with the given name are allowed to read this object. Even if this returns NO, the role may still be able to read it if a parent role has read access.

Parameters
nameThe name of the role.
Returns
YES if the role has read access, otherwise NO.
- (BOOL) getReadAccessForUser: (PFUser *)  user

Gets whether the given user is explicitly allowed to read this object. Even if this returns NO, the user may still be able to access it if publicReadAccess returns YES or if the user belongs to a role that has access.

Parameters
userThe user for which to retrive access.
Returns
YES if the user has explicit read access, otherwise NO.
- (BOOL) getReadAccessForUserId: (NSString *)  userId

Gets whether the given user id is explicitly allowed to read this object. Even if this returns NO, the user may still be able to access it if publicReadAccess returns YES or if the user belongs to a role that has access.

Parameters
userIdThe PFObject.objectId of the user for which to retrive access.
Returns
YES if the user with this objectId has explicit read access, otherwise NO.
- (BOOL) getWriteAccessForRole: (PFRole *)  role

Get whether users belonging to the given role are allowed to write this object. Even if this returns NO, the role may still be able to write it if a parent role has write access.

The role must already be saved on the server and it's data must have been fetched in order to use this method.

Parameters
roleThe name of the role.
Returns
YES if the role has write access, otherwise NO.
- (BOOL) getWriteAccessForRoleWithName: (NSString *)  name

Get whether users belonging to the role with the given name are allowed to write this object. Even if this returns NO, the role may still be able to write it if a parent role has write access.

Parameters
nameThe name of the role.
Returns
YES if the role has read access, otherwise NO.
- (BOOL) getWriteAccessForUser: (PFUser *)  user

Gets whether the given user is explicitly allowed to write this object. Even if this returns NO, the user may still be able to write it if publicWriteAccess returns YES or if the user belongs to a role that has access.

Parameters
userThe user for which to retrive access.
Returns
YES if the user has explicit write access, otherwise NO.
- (BOOL) getWriteAccessForUserId: (NSString *)  userId

Gets whether the given user id is explicitly allowed to write this object. Even if this returns NO, the user may still be able to write it if publicWriteAccess returns YES or if the user belongs to a role that has access.

Parameters
userIdThe PFObject.objectId of the user for which to retrive access.
Returns
YES if the user with this PFObject.objectId has explicit write access, otherwise NO.
+ (void) setDefaultACL: (nullable PFACL *)  acl
withAccessForCurrentUser: (BOOL)  currentUserAccess 



Sets a default ACL that will be applied to all instances of PFObject when they are created.

Parameters
aclThe ACL to use as a template for all instance of PFObject created after this method has been called. This value will be copied and used as a template for the creation of new ACLs, so changes to the instance after this method has been called will not be reflected in new instance of PFObject.
currentUserAccess- If YES, the PFACL that is applied to newly-created instance of PFObject will provide read and write access to the PFUser.+currentUser at the time of creation.
  • If NO, the provided acl will be used without modification.
  • If acl is nil, this value is ignored.
- (void) setReadAccess: (BOOL)  allowed
forRole: (PFRole *)  role 

Set whether users belonging to the given role are allowed to read this object.

The role must already be saved on the server and it's data must have been fetched in order to use this method.

Parameters
allowedWhether the given role can read this object.
roleThe role to assign access.
- (void) setReadAccess: (BOOL)  allowed
forRoleWithName: (NSString *)  name 

Set whether users belonging to the role with the given name are allowed to read this object.

Parameters
allowedWhether the given role can read this object.
nameThe name of the role.
- (void) setReadAccess: (BOOL)  allowed
forUser: (PFUser *)  user 

Set whether the given user is allowed to read this object.

Parameters
allowedWhether the given user can read this object.
userThe user to assign access.
- (void) setReadAccess: (BOOL)  allowed
forUserId: (NSString *)  userId 



Set whether the given user id is allowed to read this object.

Parameters
allowedWhether the given user can write this object.
userIdThe PFObject.objectId of the user to assign access.
- (void) setWriteAccess: (BOOL)  allowed
forRole: (PFRole *)  role 

Set whether users belonging to the given role are allowed to write this object.

The role must already be saved on the server and it's data must have been fetched in order to use this method.

Parameters
allowedWhether the given role can write this object.
roleThe role to assign access.
- (void) setWriteAccess: (BOOL)  allowed
forRoleWithName: (NSString *)  name 

Set whether users belonging to the role with the given name are allowed to write this object.

Parameters
allowedWhether the given role can write this object.
nameThe name of the role.
- (void) setWriteAccess: (BOOL)  allowed
forUser: (PFUser *)  user 

Set whether the given user is allowed to write this object.

Parameters
allowedWhether the given user can write this object.
userThe user to assign access.
- (void) setWriteAccess: (BOOL)  allowed
forUserId: (NSString *)  userId 

Set whether the given user id is allowed to write this object.

Parameters
allowedWhether the given user can read this object.
userIdThe PFObject.objectId of the user to assign access.

Property Documentation

- (BOOL) publicReadAccess
readwritenonatomicassign



Controls whether the public is allowed to read this object.

- (BOOL) publicWriteAccess
readwritenonatomicassign

Controls whether the public is allowed to write this object.


The documentation for this class was generated from the following file: