grantPermissions

fun Feature.grantPermissions(vararg permissions: String): Feature(source)

Returns a new Feature with the specified permissions granted.

This is a convenience vararg overload of grantPermissions for granting permissions inline. Permissions that already exist will not be duplicated (since Feature.permissions is a Set).

Example:

val updated = feature.grantPermissions("ADMIN", "BETA_TESTER", "POWER_USER")

Return

a new Feature with the permissions added

Parameters

permissions

the permissions to grant

See also

for the Collection version


Returns a new Feature with the specified permissions granted.

Adds the provided permissions to the feature's permission set. Permissions that already exist will not be duplicated. This maintains immutability by returning a new instance.

Example:

val newPermissions = setOf("ADMIN", "MODERATOR")
val updated = feature.grantPermissions(newPermissions)

Return

a new Feature with the permissions added

Parameters

permissions

the collection of permissions to grant