diff --git a/kolibri/core/assets/src/composables/useUser.js b/kolibri/core/assets/src/composables/useUser.js index a61c4841b4b..72d963e0d46 100644 --- a/kolibri/core/assets/src/composables/useUser.js +++ b/kolibri/core/assets/src/composables/useUser.js @@ -2,6 +2,7 @@ import { computed } from 'kolibri.lib.vueCompositionApi'; import store from 'kolibri.coreVue.vuex.store'; export default function useUser() { + //getters const isUserLoggedIn = computed(() => store.getters.isUserLoggedIn); const currentUserId = computed(() => store.getters.currentUserId); const isLearnerOnlyImport = computed(() => store.getters.isLearnerOnlyImport); @@ -10,6 +11,27 @@ export default function useUser() { const isSuperuser = computed(() => store.getters.isSuperuser); const canManageContent = computed(() => store.getters.canManageContent); const isAppContext = computed(() => store.getters.isAppContext); + const isClassCoach = computed(() => store.getters.isClassCoach); + const isFacilityCoach = computed(() => store.getters.isFacilityCoach); + const isLearner = computed(() => store.getters.isLearner); + const isFacilityAdmin = computed(() => store.getters.isFacilityAdmin); + const userIsMultipleFacility = computed(() => store.getters.userIsMultipleFacility); + const getUserPermissions = computed(() => store.getters.getUserPermissions); + const userFacilityId = computed(() => store.getters.userFacilityId); + const getUserKind = computed(() => store.getters.getUserKind); + const userHasPermissions = computed(() => store.getters.userHasPermissions); + const session = computed(() => store.getters.session); + + //state + const app_context = computed(() => store.getters.session.app_context); + const can_manage_content = computed(() => store.getters.session.can_manage_content); + const facility_id = computed(() => store.getters.session.facility_id); + const full_name = computed(() => store.getters.session.full_name); + const id = computed(() => store.getters.session.id); + const kind = computed(() => store.getters.session.kind); + const user_id = computed(() => store.getters.session.user_id); + const full_facility_import = computed(() => store.getters.session.full_facility_import); + const username = computed(() => store.getters.session.username); return { isLearnerOnlyImport, @@ -20,5 +42,25 @@ export default function useUser() { isSuperuser, canManageContent, isAppContext, + isClassCoach, + isFacilityCoach, + isLearner, + isFacilityAdmin, + userIsMultipleFacility, + getUserPermissions, + userFacilityId, + getUserKind, + userHasPermissions, + session, + //state + app_context, + can_manage_content, + facility_id, + full_name, + id, + kind, + user_id, + username, + full_facility_import, }; }