General information

Allow application to request access to permissions from user.

The application can check whether the access is granted with method users.hasAppPermission.

Method signature

FAPI.UI.showPermissions(permissions)

Where:

  • permissions - list of requested permissions

Example usage

Permissions request

var permissions = '"PHOTO_CONTENT","VALUABLE_ACCESS"';
 
function askSetStatusPermission() {
    FAPI.UI.showPermissions("[" + permissions + "]");
}

Permissions check

var permission = "PHOTO_CONTENT";
function checkPermission() {
    var callback = function(status, result, data) {
        if (result){
            alert("Exists!");
        } else {
            alert("Permission is missed");
        }
    }
    FAPI.Client.call({"method":"users.hasAppPermission", "ext_perm":permission}, callback);
}

Callback example

Callback if permissions were granted

method: “showPermissions”

result: “ok”

data: “null”

Callback if user cancelled an action

Callback for this action is not implemented yet

Dialog example