ParseACL

public struct ParseACL: ParseType,
                        Decodable,
                        Equatable,
                        Hashable
extension ParseACL: CustomDebugStringConvertible
extension ParseACL: CustomStringConvertible

ParseACL is used to control which users can access or modify a particular ParseObject. Each ParseObject has its own ACL. 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.

  • An enum specifying read and write access controls.

    See more

    Declaration

    Swift

    public enum Access : String, Codable, CodingKey
  • The default initializer.

    Declaration

    Swift

    public init()
  • Controls whether the public is allowed to read this object.

    Declaration

    Swift

    public var publicRead: Bool { get set }
  • Controls whether the public is allowed to write this object.

    Declaration

    Swift

    public var publicWrite: Bool { get set }

ParseUser

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

    Declaration

    Swift

    public func getReadAccess(objectId: String) -> Bool

    Parameters

    objectId

    The ParseUser.objectId of the user for which to retrieve access.

    Return Value

    true if the user with this objectId has explicit read access, otherwise false.

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

    Declaration

    Swift

    public func getReadAccess<T>(user: T) -> Bool where T : ParseUser

    Parameters

    user

    The ParseUser for which to retrieve access.

    Return Value

    true if the user with this ParseUser has explicit read access, otherwise false.

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

    Declaration

    Swift

    public func getWriteAccess(objectId: String) -> Bool

    Parameters

    objectId

    The ParseUser.objectId of the user for which to retrieve access.

    Return Value

    true if the user with this ParseUser.objectId has explicit write access, otherwise false.

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

    Declaration

    Swift

    public func getWriteAccess<T>(user: T) -> Bool where T : ParseUser

    Parameters

    user

    The ParseUser of the user for which to retrieve access.

    Return Value

    true if the ParseUser has explicit write access, otherwise false.

  • Set whether the given objectId is allowed to read this object.

    Declaration

    Swift

    public mutating func setReadAccess(objectId: String, value: Bool)

    Parameters

    value

    Whether the given user can read this object.

    objectId

    The ParseUser.objectId of the user to assign access.

  • Set whether the given ParseUser is allowed to read this object.

    Declaration

    Swift

    public mutating func setReadAccess<T>(user: T, value: Bool) where T : ParseUser

    Parameters

    value

    Whether the given user can read this object.

    user

    The ParseUser to assign access.

  • Set whether the given objectId is allowed to write this object.

    Declaration

    Swift

    public mutating func setWriteAccess(objectId: String, value: Bool)

    Parameters

    value

    Whether the given user can write this object.

    objectId

    The ParseUser.objectId of the user to assign access.

  • Set whether the given ParseUser is allowed to write this object.

    Declaration

    Swift

    public mutating func setWriteAccess<T>(user: T, value: Bool) where T : ParseUser

    Parameters

    value

    Whether the given user can write this object.

    user

    The ParseUser to assign access.

ParseRole

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

    Declaration

    Swift

    public func getReadAccess(roleName: String) -> Bool

    Parameters

    roleName

    The name of the role.

    Return Value

    true if the role has read access, otherwise false.

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

    Declaration

    Swift

    public func getReadAccess<T>(role: T) -> Bool where T : ParseRole

    Parameters

    role

    The ParseRole to get access for.

    Return Value

    true if the ParseRole has read access, otherwise false.

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

    Declaration

    Swift

    public func getWriteAccess(roleName: String) -> Bool

    Parameters

    roleName

    The name of the role.

    Return Value

    true if the role has read access, otherwise false.

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

    Declaration

    Swift

    public func getWriteAccess<T>(role: T) -> Bool where T : ParseRole

    Parameters

    role

    The ParseRole to get access for.

    Return Value

    true if the role has read access, otherwise false.

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

    Declaration

    Swift

    public mutating func setReadAccess(roleName: String, value: Bool)

    Parameters

    value

    Whether the given role can read this object.

    roleName

    The name of the role.

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

    Declaration

    Swift

    public mutating func setReadAccess<T>(role: T, value: Bool) where T : ParseRole

    Parameters

    value

    Whether the given role can read this object.

    role

    The ParseRole to set access for.

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

    Declaration

    Swift

    public mutating func setWriteAccess(roleName: String, value: Bool)

    Parameters

    allowed

    Whether the given role can write this object.

    roleName

    The name of the role.

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

    Declaration

    Swift

    public mutating func setWriteAccess<T>(role: T, value: Bool) where T : ParseRole

    Parameters

    allowed

    Whether the given role can write this object.

    role

    The ParseRole to set access for.

  • Get the default ACL from the Keychain.

    Declaration

    Swift

    public static func defaultACL() throws -> ParseACL

    Return Value

    Returns the default ACL.

  • Sets a default ACL that can later be used by ParseObjects.

    To apply the default ACL to all instances of a respective ParseObject when they are created, you will need to add ACL = try? ParseACL.defaultACL(). You can also at it when conforming to ParseObject:

    struct MyParseObject: ParseObject {
    
       var objectId: String?
       var createdAt: Date?
       var updatedAt: Date?
       var ACL: ParseACL? = try? ParseACL.defaultACL()
    }
    

    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 ParseObject.

    • If false, the provided acl will be used without modification.
    • If acl is nil, this value is ignored.

    Declaration

    Swift

    public static func setDefaultACL(_ acl: ParseACL, withAccessForCurrentUser: Bool) throws -> ParseACL

    Parameters

    acl

    The ACL to use as a template for instances of ParseObject.

    withAccessForCurrentUser

    If true, the ACL that is applied to newly-created instance of ParseObject will provide read and write access to the ParseUser.+currentUser at the time of creation.

    Return Value

    Updated defaultACL

  • Declaration

    Swift

    public init(from decoder: Decoder) throws
  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws

CustomDebugStringConvertible

  • Declaration

    Swift

    public var debugDescription: String { get }

CustomStringConvertible

  • Declaration

    Swift

    public var description: String { get }