For registered events and methods, we may have something like this:
```
bluetooth // the permission name
    bluetooth.read()
    bluetooth.write()
    bluetooth.dosomething() // functions registered under a permission name.
```
Now here comes a request, and we know where this request is comming from: we have the application id, extension name and the API name, for example bluetooth.write(). The first step is to find out which permission controls the function call.
As for this function, we give extension name 'bluetooth', the api_name 'write', and it will return the permission name 'bluetooth'.