feat(editor): Add routing middleware, permission checks, RBAC store, RBAC component (#7702)
Github issue / Community forum post (link here to close automatically): --------- Co-authored-by: Csaba Tuncsik <csaba@n8n.io>
This commit is contained in:
@@ -10,6 +10,7 @@ import { DateTime } from 'luxon';
|
||||
import { CLOUD_TRIAL_CHECK_INTERVAL, STORES } from '@/constants';
|
||||
|
||||
const DEFAULT_STATE: CloudPlanState = {
|
||||
initialized: false,
|
||||
data: null,
|
||||
usage: null,
|
||||
loadingPlan: false,
|
||||
@@ -157,8 +158,20 @@ export const useCloudPlanStore = defineStore(STORES.CLOUD_PLAN, () => {
|
||||
window.location.href = `https://${adminPanelHost}/login?code=${code}`;
|
||||
};
|
||||
|
||||
const initialize = async () => {
|
||||
if (state.initialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
await checkForCloudPlanData();
|
||||
await fetchUserCloudAccount();
|
||||
|
||||
state.initialized = true;
|
||||
};
|
||||
|
||||
return {
|
||||
state,
|
||||
initialize,
|
||||
getOwnerCurrentPlan,
|
||||
getInstanceCurrentUsage,
|
||||
usageLeft,
|
||||
|
||||
Reference in New Issue
Block a user