Skip to content

Commit

Permalink
Adds r/w accessors in swift for the PFACL
Browse files Browse the repository at this point in the history
fixes #1083
  • Loading branch information
flovilmart committed Jan 21, 2018
1 parent 048be1a commit 0e92bff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Parse/Parse/PFACL.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ NS_ASSUME_NONNULL_BEGIN
/**
Controls whether the public is allowed to read this object.
*/
@property (nonatomic, assign, getter=getPublicReadAccess) BOOL publicReadAccess;
@property (nonatomic, assign, getter=getPublicReadAccess) BOOL publicReadAccess NS_SWIFT_NAME(hasPublicReadAccess);

/**
Controls whether the public is allowed to write this object.
*/
@property (nonatomic, assign, getter=getPublicWriteAccess) BOOL publicWriteAccess;
@property (nonatomic, assign, getter=getPublicWriteAccess) BOOL publicWriteAccess NS_SWIFT_NAME(hasPublicWriteAccess);

///--------------------------------------
#pragma mark - Controlling Access Per-User
Expand Down
8 changes: 8 additions & 0 deletions Parse/Tests/Other/Swift/SwiftSubclass.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,12 @@ public class SwiftSubclass: PFObject, PFSubclassing {
func test_validateSwiftImport() {
let _ = SwiftSubclass(withoutDataWithObjectId: "")
}

func test_properACLSetters() {
let acl = PFACL()
acl.hasPublicReadAccess = true
acl.hasPublicWriteAccess = true
_ = acl.hasPublicWriteAccess
_ = acl.hasPublicReadAccess
}
}

0 comments on commit 0e92bff

Please sign in to comment.