fix(editor): Connect up new project viewer role to the FE (#9913)

This commit is contained in:
Csaba Tuncsik
2024-08-13 15:45:28 +02:00
committed by GitHub
parent 56c4692c94
commit 117e2d968f
56 changed files with 1482 additions and 1155 deletions

View File

@@ -8,6 +8,7 @@
:additional-filters-handler="onFilter"
:type-props="{ itemSize: 77 }"
:loading="loading"
:disabled="readOnlyEnv || !projectPermissions.credential.create"
@click:add="addCredential"
@update:filters="filters = $event"
>
@@ -79,6 +80,7 @@ import { useProjectsStore } from '@/stores/projects.store';
import ProjectTabs from '@/components/Projects/ProjectTabs.vue';
import useEnvironmentsStore from '@/stores/environments.ee.store';
import { useSettingsStore } from '@/stores/settings.store';
import { getResourcePermissions } from '@/permissions';
export default defineComponent({
name: 'CredentialsView',
@@ -131,6 +133,14 @@ export default defineComponent({
? this.$locale.baseText('credentials.project.add')
: this.$locale.baseText('credentials.add');
},
readOnlyEnv(): boolean {
return this.sourceControlStore.preferences.branchReadOnly;
},
projectPermissions() {
return getResourcePermissions(
this.projectsStore.currentProject?.scopes ?? this.projectsStore.personalProject?.scopes,
);
},
},
watch: {
'$route.params.projectId'() {