diff --git a/templates/android/library/src/main/java/io/appwrite/Role.kt.twig b/templates/android/library/src/main/java/io/appwrite/Role.kt.twig
index d5f59c3a6..2e4de9861 100644
--- a/templates/android/library/src/main/java/io/appwrite/Role.kt.twig
+++ b/templates/android/library/src/main/java/io/appwrite/Role.kt.twig
@@ -1,29 +1,72 @@
package {{ sdk.namespace | caseDot }}
+/**
+ * Helper class to generate role strings for [Permission].
+ */
class Role {
companion object {
+
+ /**
+ * Grants access to anyone.
+ *
+ * This includes authenticated and unauthenticated users.
+ */
fun any(): String = "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.
+ */
fun user(id: String, status: String = ""): String = if(status.isEmpty()) {
"user:$id"
} else {
"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.
+ */
fun users(status: String = ""): String = if(status.isEmpty()) {
"users"
} else {
"users/$status"
}
+ /**
+ * Grants access to any guest user without a session.
+ *
+ * Authenticated users don't have access to this role.
+ */
fun guests(): String = "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.
+ */
fun team(id: String, role: String = ""): String = if(role.isEmpty()) {
"team:$id"
} else {
"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.
+ */
fun member(id: String): String = "member:$id"
+
+ /**
+ * Grants access to a user with the specified label.
+ */
+ fun label(name: String): String = "label:$name"
}
}
\ No newline at end of file
diff --git a/templates/dart/lib/role.dart.twig b/templates/dart/lib/role.dart.twig
index eea9e3c65..e4c968965 100644
--- a/templates/dart/lib/role.dart.twig
+++ b/templates/dart/lib/role.dart.twig
@@ -58,4 +58,9 @@ class Role {
static String member(String id) {
return 'member:$id';
}
+
+ /// Grants access to a user with the specified label.
+ static String label(String name) {
+ return 'label:$name';
+ }
}
\ No newline at end of file
diff --git a/templates/dart/test/role_test.dart.twig b/templates/dart/test/role_test.dart.twig
index 1c06086b7..cc0fff4b4 100644
--- a/templates/dart/test/role_test.dart.twig
+++ b/templates/dart/test/role_test.dart.twig
@@ -53,4 +53,10 @@ void main() {
expect(Role.member('custom'), 'member:custom');
});
});
+
+ group('label()', () {
+ test('returns label', () {
+ expect(Role.label('admin'), 'label:admin');
+ });
+ });
}
diff --git a/templates/deno/src/role.ts.twig b/templates/deno/src/role.ts.twig
index d94e398c6..79f8c6b62 100644
--- a/templates/deno/src/role.ts.twig
+++ b/templates/deno/src/role.ts.twig
@@ -1,34 +1,100 @@
+/**
+ * Helper class to generate role strings for `Permission`.
+ */
export class Role {
+
+ /**
+ * Grants access to anyone.
+ *
+ * This includes authenticated and unauthenticated users.
+ *
+ * @returns {string}
+ */
public static 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
+ * @returns {string}
+ */
public static user(id: string, status: string = ''): string {
- if(status === '') {
+ if (status === '') {
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
+ * @returns {string}
+ */
public static users(status: string = ''): string {
- if(status === '') {
+ if (status === '') {
return 'users'
}
return `users/${status}`
}
-
+
+ /**
+ * Grants access to any guest user without a session.
+ *
+ * Authenticated users don't have access to this role.
+ *
+ * @returns {string}
+ */
public static 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
+ * @returns {string}
+ */
public static team(id: string, role: string = ''): string {
- if(role === '') {
+ if (role === '') {
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
+ * @returns {string}
+ */
public static member(id: string): string {
return `member:${id}`
}
+
+ /**
+ * Grants access to a user with the specified label.
+ *
+ * @param {string} name
+ * @returns {string}
+ */
+ public static label(name: string): string {
+ return `label:${name}`
+ }
}
\ No newline at end of file
diff --git a/templates/dotnet/src/Appwrite/Role.cs.twig b/templates/dotnet/src/Appwrite/Role.cs.twig
index 7fc1fdbcd..b3ecf2610 100644
--- a/templates/dotnet/src/Appwrite/Role.cs.twig
+++ b/templates/dotnet/src/Appwrite/Role.cs.twig
@@ -1,12 +1,28 @@
namespace Appwrite
{
+ ///
+ /// Helper class to generate role strings for Permission.
+ ///
public static class Role
{
+ ///
+ /// Grants access to anyone.
+ ///
+ /// This includes authenticated and unauthenticated users.
+ ///
+ ///
public static string Any()
{
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.
+ ///
+ ///
public static string User(string id, string status = "")
{
return status == string.Empty
@@ -14,6 +30,13 @@ namespace Appwrite
: $"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.
+ ///
+ ///
public static string Users(string status = "")
{
return status == string.Empty
@@ -21,11 +44,24 @@ namespace Appwrite
$"users/{status}";
}
+ ///
+ /// Grants access to any guest user without a session.
+ ///
+ /// Authenticated users don't have access to this role.
+ ///
+ ///
public static string Guests()
{
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.
+ ///
+ ///
public static string Team(string id, string role = "")
{
return role == string.Empty
@@ -33,9 +69,24 @@ namespace Appwrite
: $"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.
+ ///
+ ///
public static string Member(string id)
{
return $"member:{id}";
}
+
+ ///
+ /// Grants access to a user with the specified label.
+ ///
+ public static string Label(string name)
+ {
+ return $"label:{name}";
+ }
}
}
\ No newline at end of file
diff --git a/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig b/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig
index d5f59c3a6..2e4de9861 100644
--- a/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig
+++ b/templates/kotlin/src/main/kotlin/io/appwrite/Role.kt.twig
@@ -1,29 +1,72 @@
package {{ sdk.namespace | caseDot }}
+/**
+ * Helper class to generate role strings for [Permission].
+ */
class Role {
companion object {
+
+ /**
+ * Grants access to anyone.
+ *
+ * This includes authenticated and unauthenticated users.
+ */
fun any(): String = "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.
+ */
fun user(id: String, status: String = ""): String = if(status.isEmpty()) {
"user:$id"
} else {
"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.
+ */
fun users(status: String = ""): String = if(status.isEmpty()) {
"users"
} else {
"users/$status"
}
+ /**
+ * Grants access to any guest user without a session.
+ *
+ * Authenticated users don't have access to this role.
+ */
fun guests(): String = "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.
+ */
fun team(id: String, role: String = ""): String = if(role.isEmpty()) {
"team:$id"
} else {
"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.
+ */
fun member(id: String): String = "member:$id"
+
+ /**
+ * Grants access to a user with the specified label.
+ */
+ fun label(name: String): String = "label:$name"
}
}
\ No newline at end of file
diff --git a/templates/node/lib/role.js.twig b/templates/node/lib/role.js.twig
index 5c168c239..41b3cb5c4 100644
--- a/templates/node/lib/role.js.twig
+++ b/templates/node/lib/role.js.twig
@@ -1,31 +1,102 @@
+/**
+ * Helper class to generate role strings for `Permission`.
+ */
class Role {
+
+ /**
+ * Grants access to anyone.
+ *
+ * This includes authenticated and unauthenticated users.
+ *
+ * @returns {string}
+ */
static any = () => {
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
+ * @returns {string}
+ */
static user = (id, status = '') => {
- if(status === '') {
+ if (status === '') {
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
+ * @returns {string}
+ */
static users = (status = '') => {
- if(status === '') {
+ if (status === '') {
return 'users'
}
return `users/${status}`
}
+
+ /**
+ * Grants access to any guest user without a session.
+ *
+ * Authenticated users don't have access to this role.
+ *
+ * @returns {string}
+ */
static guests = () => {
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
+ * @returns {string}
+ */
static team = (id, role = '') => {
- if(role === '') {
+ if (role === '') {
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
+ * @returns {string}
+ */
static member = (id) => {
return 'member:' + id
}
+
+ /**
+ * Grants access to a user with the specified label.
+ *
+ * @param {string} name
+ * @returns {string}
+ */
+ static label = (name) => {
+ return 'label:' + name;
+ }
}
module.exports = Role;
\ No newline at end of file
diff --git a/templates/php/src/Role.php.twig b/templates/php/src/Role.php.twig
index 87cf43a1d..a412ce97e 100644
--- a/templates/php/src/Role.php.twig
+++ b/templates/php/src/Role.php.twig
@@ -2,12 +2,33 @@
namespace {{ spec.title | caseUcfirst }};
+/**
+ * Helper class to generate role strings for Permission.
+ */
class Role
{
+ /**
+ * Grants access to anyone.
+ *
+ * This includes authenticated and unauthenticated users.
+ *
+ * @return string
+ */
public static function 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 function user(string $id, string $status = ""): string
{
if(empty($status)) {
@@ -15,6 +36,16 @@ class Role
}
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 function users(string $status = ""): string
{
if(empty($status)) {
@@ -22,10 +53,29 @@ class Role
}
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 function 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 function team(string $id, string $role = ""): string
{
if(empty($role)) {
@@ -33,8 +83,29 @@ class Role
}
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 function member(string $id): string
{
return "member:$id";
}
+
+ /**
+ * Grants access to a user with the specified label.
+ *
+ * @param string $name
+ * @return string
+ */
+ public static function label(string $name): string
+ {
+ return "label:$name";
+ }
}
\ No newline at end of file
diff --git a/templates/python/package/role.py.twig b/templates/python/package/role.py.twig
index c79482670..8506fe1e4 100644
--- a/templates/python/package/role.py.twig
+++ b/templates/python/package/role.py.twig
@@ -1,30 +1,111 @@
class Role:
+ """Helper class to generate role strings for `Permission`."""
@staticmethod
def any():
+ """Grants access to anyone.
+
+ This includes authenticated and unauthenticated users.
+ """
return 'any'
@staticmethod
def user(id, status = ""):
+ """Grants access to a specific user by user ID.
+
+ You can optionally pass verified or unverified for
+ `status` to target specific types of users.
+
+ Parameters
+ ----------
+ id : str
+ status : str, optional
+
+ Returns
+ -------
+ str
+ """
if status:
return f'user:{id}/{status}'
return f'user:{id}'
@staticmethod
def users(status = ""):
+ """Grants access to any authenticated or anonymous user.
+
+ You can optionally pass verified or unverified for
+ `status` to target specific types of users.
+
+ Parameters
+ ----------
+ status : str, optional
+
+ Returns
+ -------
+ str
+ """
if status:
return f'users/{status}'
return 'users'
@staticmethod
def guests():
+ """Grants access to any guest user without a session.
+
+ Authenticated users don't have access to this role.
+
+ Returns
+ -------
+ str
+ """
return 'guests'
@staticmethod
def team(id, role = ""):
+ """Grants access to a team by team ID.
+
+ You can optionally pass a role for `role` to target
+ team members with the specified role.
+
+ Parameters
+ ----------
+ id : str
+ role : str, optional
+
+ Returns
+ -------
+ str
+ """
if role:
return f'team:{id}/{role}'
return f'team:{id}'
@staticmethod
def member(id):
- return f'member:{id}'
\ No newline at end of file
+ """Grants access to a specific member of a team.
+
+ When the member is removed from the team, they will
+ no longer have access.
+
+ Parameters
+ ----------
+ id : str
+
+ Returns
+ -------
+ str
+ """
+ return f'member:{id}'
+
+ @staticmethod
+ def label(name):
+ """Grants access to a user with the specified label.
+
+ Parameters
+ ----------
+ name : str
+
+ Returns
+ -------
+ str
+ """
+ return f'label:{name}'
\ No newline at end of file
diff --git a/templates/ruby/lib/container/role.rb.twig b/templates/ruby/lib/container/role.rb.twig
index 6333fbd64..c3cf9f23d 100644
--- a/templates/ruby/lib/container/role.rb.twig
+++ b/templates/ruby/lib/container/role.rb.twig
@@ -1,9 +1,26 @@
module {{spec.title | caseUcfirst}}
+
+ # Helper class to generate role strings for `Permission`.
class Role
+
+ # Grants access to anyone.
+ #
+ # This includes authenticated and unauthenticated users.
+ #
+ # @return [String]
def self.any
'any'
end
+ # 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]
def self.user(id, status = "")
if(status.empty?)
"user:#{id}"
@@ -12,6 +29,14 @@ module {{spec.title | caseUcfirst}}
end
end
+ # 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]
def self.users(status = "")
if(status.empty?)
'users'
@@ -20,10 +45,24 @@ module {{spec.title | caseUcfirst}}
end
end
+ # Grants access to any guest user without a session.
+ #
+ # Authenticated users don't have access to this role.
+ #
+ # @return [String]
def self.guests
'guests'
end
+ # 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]
def self.team(id, role = "")
if(role.empty?)
"team:#{id}"
@@ -32,8 +71,25 @@ module {{spec.title | caseUcfirst}}
end
end
+ # 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]
def self.member(id)
"member:#{id}"
end
+
+ # Grants access to a user with the specified label.
+ #
+ # @param [String] name
+ #
+ # @return [String]
+ def self.label(name)
+ "label:#{name}"
+ end
end
end
\ No newline at end of file
diff --git a/templates/swift/Sources/Role.swift.twig b/templates/swift/Sources/Role.swift.twig
index b8acdbb32..1e8e755f5 100644
--- a/templates/swift/Sources/Role.swift.twig
+++ b/templates/swift/Sources/Role.swift.twig
@@ -1,8 +1,21 @@
+/// 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)"
@@ -10,6 +23,13 @@ public class Role {
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"
@@ -17,10 +37,23 @@ public class Role {
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)"
@@ -28,7 +61,22 @@ public class Role {
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)"
+ }
}
\ No newline at end of file
diff --git a/templates/web/src/role.ts.twig b/templates/web/src/role.ts.twig
index d94e398c6..79f8c6b62 100644
--- a/templates/web/src/role.ts.twig
+++ b/templates/web/src/role.ts.twig
@@ -1,34 +1,100 @@
+/**
+ * Helper class to generate role strings for `Permission`.
+ */
export class Role {
+
+ /**
+ * Grants access to anyone.
+ *
+ * This includes authenticated and unauthenticated users.
+ *
+ * @returns {string}
+ */
public static 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
+ * @returns {string}
+ */
public static user(id: string, status: string = ''): string {
- if(status === '') {
+ if (status === '') {
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
+ * @returns {string}
+ */
public static users(status: string = ''): string {
- if(status === '') {
+ if (status === '') {
return 'users'
}
return `users/${status}`
}
-
+
+ /**
+ * Grants access to any guest user without a session.
+ *
+ * Authenticated users don't have access to this role.
+ *
+ * @returns {string}
+ */
public static 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
+ * @returns {string}
+ */
public static team(id: string, role: string = ''): string {
- if(role === '') {
+ if (role === '') {
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
+ * @returns {string}
+ */
public static member(id: string): string {
return `member:${id}`
}
+
+ /**
+ * Grants access to a user with the specified label.
+ *
+ * @param {string} name
+ * @returns {string}
+ */
+ public static label(name: string): string {
+ return `label:${name}`
+ }
}
\ No newline at end of file
diff --git a/tests/Base.php b/tests/Base.php
index 2df5b08cf..010cb000d 100644
--- a/tests/Base.php
+++ b/tests/Base.php
@@ -93,6 +93,7 @@ abstract class Base extends TestCase
'create("member:memberId")',
'update("users/verified")',
'update("user:userid/unverified")',
+ 'create("label:admin")',
];
protected const ID_HELPER_RESPONSES = [
diff --git a/tests/languages/android/Tests.kt b/tests/languages/android/Tests.kt
index 0df42c522..0aa35000e 100644
--- a/tests/languages/android/Tests.kt
+++ b/tests/languages/android/Tests.kt
@@ -192,6 +192,7 @@ class ServiceTest {
writeToFile(Permission.create(Role.member("memberId")))
writeToFile(Permission.update(Role.users("verified")))
writeToFile(Permission.update(Role.user(ID.custom("userid"), "unverified")))
+ writeToFile(Permission.create(Role.label("admin")))
// ID helper tests
writeToFile(ID.unique())
diff --git a/tests/languages/apple/Tests.swift b/tests/languages/apple/Tests.swift
index 64fa928a7..06cd5144f 100644
--- a/tests/languages/apple/Tests.swift
+++ b/tests/languages/apple/Tests.swift
@@ -175,6 +175,7 @@ class Tests: XCTestCase {
print(Permission.create(Role.member("memberId")))
print(Permission.update(Role.users("verified")))
print(Permission.update(Role.user(ID.custom("userid"), "unverified")))
+ print(Permission.create(Role.label("admin")))
// ID helper tests
print(ID.unique())
diff --git a/tests/languages/dart/tests.dart b/tests/languages/dart/tests.dart
index a77117dfc..94c474ab2 100644
--- a/tests/languages/dart/tests.dart
+++ b/tests/languages/dart/tests.dart
@@ -120,6 +120,7 @@ void main() async {
print(Permission.create(Role.member('memberId')));
print(Permission.update(Role.users('verified')));
print(Permission.update(Role.user(ID.custom('userid'), 'unverified')));
+ print(Permission.create(Role.label('admin')));
// ID helper tests
print(ID.unique());
diff --git a/tests/languages/deno/tests.ts b/tests/languages/deno/tests.ts
index ae9cfe37e..f0bb47138 100644
--- a/tests/languages/deno/tests.ts
+++ b/tests/languages/deno/tests.ts
@@ -129,6 +129,7 @@ async function start() {
console.log(Permission.create(Role.member('memberId')));
console.log(Permission.update(Role.users('verified')));
console.log(Permission.update(Role.user(ID.custom('userid'), 'unverified')));
+ console.log(Permission.create(Role.label('admin')));
// ID helper tests
console.log(ID.unique());
diff --git a/tests/languages/dotnet/Tests.cs b/tests/languages/dotnet/Tests.cs
index cb6b765d6..c01946a74 100644
--- a/tests/languages/dotnet/Tests.cs
+++ b/tests/languages/dotnet/Tests.cs
@@ -136,8 +136,9 @@ public async Task Test1()
TestContext.WriteLine(Permission.Delete(Role.Team("teamId", "owner")));
TestContext.WriteLine(Permission.Delete(Role.Team("teamId")));
TestContext.WriteLine(Permission.Create(Role.Member("memberId")));
- TestContext.WriteLine(Permission.Update(Role.Users("verified")));;
- TestContext.WriteLine(Permission.Update(Role.User(ID.Custom("userid"), "unverified")));;
+ TestContext.WriteLine(Permission.Update(Role.Users("verified")));
+ TestContext.WriteLine(Permission.Update(Role.User(ID.Custom("userid"), "unverified")));
+ TestContext.WriteLine(Permission.Create(Role.Label("admin")));
// ID helper tests
TestContext.WriteLine(ID.Unique());
diff --git a/tests/languages/flutter/tests.dart b/tests/languages/flutter/tests.dart
index 8b13681e4..b6fb89e3b 100644
--- a/tests/languages/flutter/tests.dart
+++ b/tests/languages/flutter/tests.dart
@@ -153,6 +153,7 @@ void main() async {
print(Permission.create(Role.member('memberId')));
print(Permission.update(Role.users('verified')));
print(Permission.update(Role.user(ID.custom('userid'), 'unverified')));
+ print(Permission.create(Role.label('admin')));
// ID helper tests
print(ID.unique());
diff --git a/tests/languages/kotlin/Tests.kt b/tests/languages/kotlin/Tests.kt
index 0edf3e896..33b4ae06a 100644
--- a/tests/languages/kotlin/Tests.kt
+++ b/tests/languages/kotlin/Tests.kt
@@ -152,6 +152,7 @@ class ServiceTest {
writeToFile(Permission.create(Role.member("memberId")))
writeToFile(Permission.update(Role.users("verified")));
writeToFile(Permission.update(Role.user(ID.custom("userid"), "unverified")));
+ writeToFile(Permission.create(Role.label("admin")));
// ID helper tests
writeToFile(ID.unique())
diff --git a/tests/languages/node/test.js b/tests/languages/node/test.js
index 03da67da1..259e7c0ea 100644
--- a/tests/languages/node/test.js
+++ b/tests/languages/node/test.js
@@ -117,6 +117,7 @@ async function start() {
console.log(Permission.create(Role.member('memberId')));
console.log(Permission.update(Role.users('verified')));
console.log(Permission.update(Role.user(ID.custom('userid'), 'unverified')));
+ console.log(Permission.create(Role.label('admin')));
// ID helper tests
console.log(ID.unique());
diff --git a/tests/languages/php/test.php b/tests/languages/php/test.php
index 2bc98da87..4f74f4e60 100644
--- a/tests/languages/php/test.php
+++ b/tests/languages/php/test.php
@@ -135,6 +135,7 @@
echo Permission::create(Role::member('memberId')) . "\n";
echo Permission::update(Role::users('verified')) . "\n";
echo Permission::update(Role::user(ID::custom('userid'), 'unverified')) . "\n";
+echo Permission::create(Role::label('admin')) . "\n";
// ID helper tests
echo ID::unique() . "\n";
diff --git a/tests/languages/python/tests.py b/tests/languages/python/tests.py
index 9c262b29c..99f70c301 100644
--- a/tests/languages/python/tests.py
+++ b/tests/languages/python/tests.py
@@ -124,6 +124,7 @@
print(Permission.create(Role.member('memberId')))
print(Permission.update(Role.users('verified')))
print(Permission.update(Role.user(ID.custom('userid'), 'unverified')))
+print(Permission.create(Role.label('admin')))
# ID helper tests
print(ID.unique())
diff --git a/tests/languages/ruby/tests.rb b/tests/languages/ruby/tests.rb
index dc14cafe4..37fb0ef61 100644
--- a/tests/languages/ruby/tests.rb
+++ b/tests/languages/ruby/tests.rb
@@ -133,6 +133,7 @@
puts Permission.create(Role.member('memberId'))
puts Permission.update(Role.users('verified'))
puts Permission.update(Role.user(ID.custom('userid'), 'unverified'))
+puts Permission.create(Role.label('admin'))
# ID helper tests
puts ID.unique()
diff --git a/tests/languages/swift/Tests.swift b/tests/languages/swift/Tests.swift
index ab8d3847b..948de3601 100644
--- a/tests/languages/swift/Tests.swift
+++ b/tests/languages/swift/Tests.swift
@@ -156,6 +156,7 @@ class Tests: XCTestCase {
print(Permission.create(Role.member("memberId")))
print(Permission.update(Role.users("verified")))
print(Permission.update(Role.user(ID.custom("userid"), "unverified")))
+ print(Permission.create(Role.label("admin")))
// ID helper tests
print(ID.unique())
diff --git a/tests/languages/web/index.html b/tests/languages/web/index.html
index b7396a113..17387180f 100644
--- a/tests/languages/web/index.html
+++ b/tests/languages/web/index.html
@@ -145,6 +145,7 @@
console.log(Permission.create(Role.member('memberId')));
console.log(Permission.update(Role.users('verified')));
console.log(Permission.update(Role.user(ID.custom('userid'), 'unverified')));
+ console.log(Permission.create(Role.label('admin')));
// ID helper tests
diff --git a/tests/languages/web/node.js b/tests/languages/web/node.js
index 9a95c0a70..0ec235512 100644
--- a/tests/languages/web/node.js
+++ b/tests/languages/web/node.js
@@ -102,6 +102,7 @@ async function start() {
console.log(Permission.create(Role.member('memberId')));
console.log(Permission.update(Role.users('verified')));
console.log(Permission.update(Role.user(ID.custom('userid'), 'unverified')));
+ console.log(Permission.create(Role.label('admin')));
// ID helper tests