diff --git a/src/components/AddSheet.vue b/src/components/AddSheet.vue
index a1dead4..a728480 100644
--- a/src/components/AddSheet.vue
+++ b/src/components/AddSheet.vue
@@ -35,10 +35,11 @@
Quota and rules for group {{ group }}:
-
- Active sheets:
- {{ groupUsage.total_sheets || 0 }} out of
- {{ displayPermissionValue(groupPermissions?.max_sheets, "")}}
- maxed out
+ Active sheets:
+ {{ groupUsage.total_sheets || 0 }} out of
+ {{ displayPermissionValue(groupPermissions?.max_sheets, "") }}
+ maxed out
- Monthly URLs: {{ groupUsage.monthly_urls || 0 }} out of {{
displayPermissionValue(groupPermissions?.max_monthly_urls, " URLs") }}
@@ -47,7 +48,8 @@
- How long will we store these archives: {{
displayPermissionValue(groupPermissions?.max_archive_lifespan_months, " months") }}
- - You {{ groupPermissions?.manually_trigger_sheet?"can":"cannot" }} manually trigger sheeets in this group.
+ - You {{ groupPermissions?.manually_trigger_sheet ? "can" : "cannot" }} manually
+ trigger sheeets in this group.
@@ -101,7 +103,10 @@ export default {
return this.sheetName && this.spreadsheetId && this.availableGroups?.some(g => g.value === this.group) && this.availableFrequencies?.some(f => f === this.frequency) && !this.maxedOutGroupQuota;
},
availableGroups() {
- return (this.$store.state.user?.groups || []).map(g => ({ title: g, value: g }));
+ const permissions = this.$store.state.user?.permissions || {};
+ return Object.keys(permissions)
+ .filter(group => group !== "all" && permissions[group].archive_sheet)
+ .map(g => ({ title: g, value: g }));
},
availableFrequencies() {
return this.$store.state.user?.permissions?.[this.group]?.sheet_frequency || [];
@@ -112,7 +117,8 @@ export default {
groupUsage() {
return this.$store.state.user?.usage?.["groups"]?.[this.group] || {};
},
- maxedOutGroupQuota(){
+ maxedOutGroupQuota() {
+ if (this.groupPermissions?.archive_sheet === false) return true;
if (this.groupPermissions.max_sheets === -1) return false;
return this.groupUsage.total_sheets >= this.groupPermissions.max_sheets;
},
diff --git a/src/views/ArchiveUrlView.vue b/src/views/ArchiveUrlView.vue
index e52299c..fc24ec8 100644
--- a/src/views/ArchiveUrlView.vue
+++ b/src/views/ArchiveUrlView.vue
@@ -92,8 +92,6 @@ export default {
},
data() {
return {
- availableGroups: [{ title: "only me", value: "" }].concat((this.$store.state.user?.groups || []).map(g => ({ title: g, value: g }))),
-
url: "",
public: true,
group: "",
@@ -124,6 +122,14 @@ export default {
validUrl() {
return this.url && this.urlValidator(this.url) === true;
},
+ availableGroups() {
+ const permissions = this.$store.state.user?.permissions || {};
+ return [{ title: "only me", value: "" }].concat(
+ Object.keys(permissions)
+ .filter(group => group !== "all" && permissions[group].archive_url)
+ .map(g => ({ title: g, value: g }))
+ );
+ },
globalUsage() {
return this.$store.state.user?.usage || {};
},