requestPermission
RequestPermission is a general mechanism used by software to ask a user for consent to access a protected resource or capability. The process typically results in a consent prompt, and the user's decision determines whether the application may proceed to use the resource. Permissions can be granted temporarily or persist across sessions, depending on the platform and policy.
- Web browsers: Web platforms implement permissions for features such as notifications, geolocation, camera, and microphone. Some
- Mobile platforms: Android and iOS require apps to declare required permissions and request them at runtime.
- Desktop and other environments: Many frameworks implement similar flows for access to files, devices, or system
The application initiates a permission request to access a resource. The system presents a user interface asking
- Request only when the resource is genuinely needed and immediately relevant.
- Provide a clear, user-facing explanation of why access is required.
- Handle denial gracefully and offer alternatives or fallback behavior.
- Respect changes in permission state and avoid repeated, intrusive prompts.
Security and privacy considerations
The request-permission model supports least-privilege principles, helping protect user data and system resources by requiring explicit
Permissions API; Notification permission; Geolocation access; Camera and microphone access; Runtime permissions.