elevate( )


Creates a copy of a method that includes the elevated permissions required by the original method.

Some methods are restricted as to who can call them, based on identities and/or permissions. For example, the createProduct() method can only be called by Wix users, while the confirmBooking() method can only be called by site collaborators who have certain administrative bookings permissions.

Methods that have authentication restrictions are indicated by an authentication note in their descriptions.

When you need to call a method without the necessary authentication or permissions, create an elevated version of the method and call that elevated method instead.

Due to potential security issues, the elevate() method can only be called in the backend.

Warning: Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely. Be selective about when to use elevate(), especially when writing backend code that can be triggered from the frontend using a web method or backend code that is exposed as an API using HTTP functions.

Method Declaration
Copy
Method Parameters
sourceFunctionFunctionRequired

Function of which to create an instance with elevated permissions.

Returns
Return Type:Function
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?