PermissionHolder

An entity that holds a set of granted Permissions and provides convenience methods to check whether specific permissions are available.

See also

Inheritors

Properties

Link copied to clipboard
abstract val permissions: Set<Permission>

The set of permissions granted to this holder.

Link copied to clipboard
abstract val rootFileSystem: FileSystem?

The root file system used to determine whether a file resides within the project directory. If null, all file reads are considered global (requiring Permission.GlobalRead).

Functions

Link copied to clipboard

Throws a MissingPermissionException if the required permission is not granted to this holder.

Link copied to clipboard
fun PermissionHolder.requireReadPermission(file: File, message: String = "Cannot access file ")

Throws a MissingPermissionException if the holder does not have the required permission to read the given file. The required permission depends on whether the file is inside the project directory (Permission.ProjectRead) or outside it (Permission.GlobalRead).