android-components / mozilla.components.concept.engine.permission / PermissionRequest


interface PermissionRequest (source)

Represents a permission request, used when engines need access to protected resources. Every request must be handled by either calling grant or reject.


Name Summary
permissions abstract val permissions: List<Permission>
List of requested permissions.
uri abstract val uri: String?
The origin URI which caused the permissions to be requested.


Name Summary
containsVideoAndAudioSources open fun containsVideoAndAudioSources(): Boolean
grant abstract fun grant(permissions: List<Permission> = this.permissions): Unit
Grants the provided permissions, or all requested permissions, if none are provided.
grantIf open fun grantIf(predicate: (Permission) -> Boolean): Boolean
Grants this permission request if the provided predicate is true for any of the requested permissions.
reject abstract fun reject(): Unit
Rejects the requested permissions.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.


Name Summary
GeckoPermissionRequest sealed class GeckoPermissionRequest : PermissionRequest
Gecko-based implementation of PermissionRequest.
SystemPermissionRequest class SystemPermissionRequest : PermissionRequest
WebView-based implementation of PermissionRequest.