ProductOpener::APICurrentUser - API for accessing current user data
This module implements GET /api/v3/current-user/permissions
It returns the current user's permissions (including moderator/admin flags) from the Open Food Facts server database.
Authentication is via a Keycloak Bearer token passed in the Authorization header. The token is validated by process_auth_header() before this function is called, which sets $request_ref->{oidc_user_id} to the authenticated user's ID.
Process API V3 GET /api/v3/current-user/permissions requests.
Returns the authenticated user's permissions including moderator and admin flags. Requires a valid Keycloak Bearer token in the Authorization header.
Reference to the request object. Must have $request_ref->{oidc_user_id} set by process_auth_header() prior to this call.
On success: { "status": "success", "user": { "userid": "swastik", "name": "Swastik Panigrahi", "moderator": 0, "admin": 0 } }
On error (not authenticated): HTTP 401 with error details On error (invalid sub-action): HTTP 404 with error details