add "only platform admin can create groups" and "only groups can create events" restrictions
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
)
|
||||
}}
|
||||
</p>
|
||||
<div class="buttons">
|
||||
<div class="buttons" v-if="!hideCreateEventButton">
|
||||
<router-link
|
||||
class="button is-primary"
|
||||
:to="{ name: RouteName.CREATE_EVENT }"
|
||||
@@ -126,6 +126,8 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { CONFIG } from "../../graphql/config";
|
||||
import { IConfig } from "../../types/config.model";
|
||||
import { Component, Vue } from "vue-property-decorator";
|
||||
import { ParticipantRole } from "@/types/enums";
|
||||
import RouteName from "@/router/name";
|
||||
@@ -147,6 +149,7 @@ import Subtitle from "../../components/Utils/Subtitle.vue";
|
||||
EventListCard,
|
||||
},
|
||||
apollo: {
|
||||
config: CONFIG,
|
||||
futureParticipations: {
|
||||
query: LOGGED_USER_PARTICIPATIONS,
|
||||
fetchPolicy: "cache-and-network",
|
||||
@@ -197,6 +200,8 @@ export default class MyEvents extends Vue {
|
||||
|
||||
limit = 10;
|
||||
|
||||
config!: IConfig;
|
||||
|
||||
futureParticipations: IParticipant[] = [];
|
||||
|
||||
hasMoreFutureParticipations = true;
|
||||
@@ -286,6 +291,10 @@ export default class MyEvents extends Vue {
|
||||
(participation) => participation.event.id !== eventid
|
||||
);
|
||||
}
|
||||
|
||||
get hideCreateEventButton(): boolean {
|
||||
return !!this.config?.restrictions?.onlyGroupsCanCreateEvents;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user