enhance(client): ロールをより簡単に付与できるように

This commit is contained in:
syuilo
2023-02-11 12:55:22 +09:00
parent abc1bdf218
commit 040f9927dd
3 changed files with 28 additions and 0 deletions

View File

@@ -203,6 +203,20 @@ export function getUserMenu(user, router: Router = mainRouter) {
action: () => {
router.push('/user-info/' + user.id + '#moderation');
},
}, {
icon: 'ti ti-badges',
text: i18n.ts.roles,
action: async () => {
const roles = await os.api('admin/roles/list');
const { canceled, result: roleId } = await os.select({
title: i18n.ts._role.chooseRoleToAssign,
items: roles.map(r => ({ text: r.name, value: r.id })),
});
if (canceled) return;
await os.apiWithDialog('admin/roles/assign', { roleId, userId: user.id });
},
}]);
}
}