mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-16 13:23:45 +02:00
Add handler to fetch all of the system permissions and load them into the state
This commit is contained in:
10
resources/scripts/api/getSystemPermissions.ts
Normal file
10
resources/scripts/api/getSystemPermissions.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { SubuserPermission } from '@/state/server/subusers';
|
||||
import http from '@/api/http';
|
||||
|
||||
export default (): Promise<SubuserPermission[]> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.get(`/api/client/permissions`)
|
||||
.then(({ data }) => resolve(data.attributes.permissions))
|
||||
.catch(reject);
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user