读取/修改用户权限
获取用户权限和角色
Authing.queryPermissions('USER_ID'); (async function() { const authing = await new Authing({ clientId: 'your_client_id', timestamp: Math.round(new Date() / 1000), nonce: Math.ceil(Math.random() * Math.pow(10, 6)), }); const groupList = await authing.queryPermissions('USER_ID') .catch((error) => { ... });; })();
{ "totalCount": 2, "list": [ { "group": { "name": "管理员", "permissions": "{\"routes\": \"/api/v1\"}" } }, { "group": { "name": "读者", "permissions": "" } } ] }
获取应用下所有角色
创建用户角色
修改角色权限
指派用户到某角色
将用户从某角色中移除
Last updated
Was this helpful?