Note: This article discusses elevation when extending websites, but the concepts and implementation are the same when coding in Blocks.
Elevation lets you call restricted Wix API methods even when the current identity lacks the necessary permissions.
Note: Due to potential security risks, you can only elevate methods in backend code.
Use the elevate() function from wix-auth:
Methods can be restricted based on user identity or roles and permissions:
assignBadge() requires elevation when called outside a dashboard page, since site members can't assign badges to themselves.confirmBooking() requires elevation when called on behalf of a user without an administrative Bookings role.While elevation offers flexibility, it's crucial to consider how and when elevation is triggered. Web methods and HTTP functions are particularly vulnerable if not properly managed due to their open nature. Elevation in backend events or code only triggered from scheduled jobs presents less risk but should still be handled cautiously.
To demonstrate how to properly handle elevation, consider a site that rewards frequent visitors with a special badge. To do so, the code needs to track recent member visits and call assignBadge() using elevation when a member has visited frequently enough. (Note that the code samples below have been simplified, removing error handling and other non-essential code.)
Here is an example of an insecure approach to writing this code:
There are several problems with the assignBadge() web method used in this approach:
Because of these issues, this method can be called by a malicious user to assign any badge to any member.
You can easily remedy these issues by being more careful about where you use elevation and how you expose it to be called.
For example:
In this approach, the following makes sure the elevation is not exploited by malicious users:
Last updated: 31 August 2026