requireReadPermission

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).

Parameters

file

the file to check read access for

message

a descriptive message to include in the exception if the permission is missing

See also

Throws

if the required read permission is not granted to this holder