-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from appwrite/dev
fix: patch updates for appwrite 1.4.1
- Loading branch information
Showing
13 changed files
with
1,039 additions
and
991 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
 | ||
 | ||
 | ||
 | ||
[](https://travis-ci.com/appwrite/sdk-generator) | ||
[](https://twitter.com/appwrite) | ||
[](https://appwrite.io/discord) | ||
|
@@ -33,7 +33,7 @@ Add the package to your `Package.swift` dependencies: | |
|
||
```swift | ||
dependencies: [ | ||
.package(url: "[email protected]:appwrite/sdk-for-swift.git", from: "3.0.0"), | ||
.package(url: "[email protected]:appwrite/sdk-for-swift.git", from: "3.0.1"), | ||
], | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,82 @@ | ||
/// Helper class to generate role strings for `Permission`. | ||
public class Role { | ||
|
||
/// Grants access to anyone. | ||
/// | ||
/// This includes authenticated and unauthenticated users. | ||
public static func any() -> String { | ||
return "any" | ||
} | ||
|
||
/// Grants access to a specific user by user ID. | ||
/// | ||
/// You can optionally pass verified or unverified for | ||
/// `status` to target specific types of users. | ||
/// | ||
/// @param String id | ||
/// @param String status | ||
/// @return String | ||
public static func user(_ id: String, _ status: String = "") -> String { | ||
if(status.isEmpty) { | ||
return "user:\(id)" | ||
} | ||
return "user:\(id)/\(status)" | ||
} | ||
|
||
/// Grants access to any authenticated or anonymous user. | ||
/// | ||
/// You can optionally pass verified or unverified for | ||
/// `status` to target specific types of users. | ||
/// | ||
/// @param String status | ||
/// @return String | ||
public static func users(_ status: String = "") -> String { | ||
if(status.isEmpty) { | ||
return "users" | ||
} | ||
return "users/\(status)" | ||
} | ||
|
||
/// Grants access to any guest user without a session. | ||
/// | ||
/// Authenticated users don't have access to this role. | ||
/// | ||
/// @return String | ||
public static func guests() -> String { | ||
return "guests" | ||
} | ||
|
||
/// Grants access to a team by team ID. | ||
/// | ||
/// You can optionally pass a role for `role` to target | ||
/// team members with the specified role. | ||
/// | ||
/// @param String id | ||
/// @param String role | ||
/// @return String | ||
public static func team(_ id: String, _ role: String = "") -> String { | ||
if(role.isEmpty) { | ||
return "team:\(id)" | ||
} | ||
return "team:\(id)/\(role)" | ||
} | ||
|
||
/// Grants access to a specific member of a team. | ||
/// | ||
/// When the member is removed from the team, they will | ||
/// no longer have access. | ||
/// | ||
/// @param String id | ||
/// @return String | ||
public static func member(_ id: String) -> String { | ||
return "member:\(id)" | ||
} | ||
|
||
/// Grants access to a user with the specified label. | ||
/// | ||
/// @param String name | ||
/// @return String | ||
public static func label(_ name: String) -> String { | ||
return "label:\(name)" | ||
} | ||
} |
Oops, something went wrong.