mirror of
https://github.com/directus/directus.git
synced 2026-04-03 03:00:39 -04:00
hydrate permissionsStore only if user has role (#8893)
This commit is contained in:
@@ -60,11 +60,11 @@ export async function hydrate(stores = useStores()): Promise<void> {
|
||||
* else.
|
||||
*/
|
||||
await userStore.hydrate();
|
||||
await permissionsStore.hydrate();
|
||||
|
||||
const hydratedStores = ['userStore', 'permissionsStore'];
|
||||
|
||||
if (userStore.currentUser?.role) {
|
||||
await permissionsStore.hydrate();
|
||||
const hydratedStores = ['userStore', 'permissionsStore'];
|
||||
|
||||
await Promise.all(stores.filter(({ $id }) => !hydratedStores.includes($id)).map((store) => store.hydrate?.()));
|
||||
await registerModules();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user