Is it possible to query the current user's permiss...
# suiteql
d
Is it possible to query the current user's permissions using just SuiteQL?
I found this resource which is helpful for finding all user permissions for oauthtokens, but it doesn't tell me who the current user is.
m
You can use the runtime module to get the current user and then get the current user’s permission
d
Using the runtime module requires changing the suitescript, correct? Do you know if it's possible using only suiteql?
m
what do you mean by changing the suitescript?
Copy code
var userObj = runtime.getCurrentUser();
var userPermission = userObj.getPermission({
    name = 'ADMI_ACCOUNTING'
});
There probably is a way. There are a few tables I saw. It would be a matter of linking them correctly. PermissionType rolePermissions employeeRoles
d
what do you mean by changing the suitescript
In the environment I'd like to retrieve this information, I don't have the ability to change the suitescript being executed, but I do have permission to run suiteql queries. That's why I'd like to be able to run this entirely in suiteql.
I found a workaround here. I can use the
tokeninfo
endpoint to get the current role, then work backwards to get the permissions.