Skip to content

Commit

Permalink
Manage user persmissions to view users management in LOD
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVelezLl committed Jun 26, 2024
1 parent 1d00a7c commit 7ce5576
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 5 additions & 1 deletion kolibri/core/assets/src/views/SideNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@
.filter(item => item.section !== NavComponentSections.ACCOUNT)
.sort(this.compareMenuItems)
.filter(this.filterByRole)
.filter(this.filterByFullFacilityOnly);
.filter(this.filterByFullFacilityOnly)
.filter(this.filterByLODOnly);
},
accountItems() {
const accountItems = this.navItems
Expand Down Expand Up @@ -473,6 +474,9 @@
filterByFullFacilityOnly(item) {
return !this.isLearnerOnlyImport || !item.fullFacilityOnly;
},
filterByLODOnly(item) {
return this.isLearnerOnlyImport || !item.lodOnly;
},
/**
* @public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
};
},
computed: {
...mapGetters(['isUserLoggedIn']),
...mapGetters(['canManageContent']),
userIsAuthorized() {
return this.isUserLoggedIn;
return this.canManageContent;
},
},
created() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UserKinds } from 'kolibri.coreVue.vuex.constants';
import { UserKinds, NavComponentSections } from 'kolibri.coreVue.vuex.constants';
import registerNavItem from 'kolibri.utils.registerNavItem';
import urls from 'kolibri.urls';
import coreStrings from 'kolibri.utils.coreStrings';
Expand All @@ -11,5 +11,7 @@ registerNavItem({
return coreStrings.$tr('usersLabel');
},
icon: 'audience',
role: UserKinds.ADMIN,
role: UserKinds.CAN_MANAGE_CONTENT,
section: NavComponentSections.ACCOUNT,
lodOnly: true,
});

0 comments on commit 7ce5576

Please sign in to comment.