fixing available groups in sheet/url

This commit is contained in:
msramalho
2025-02-07 16:52:14 +00:00
parent c1a7dcd1eb
commit 8d05ce5452
2 changed files with 21 additions and 9 deletions

View File

@@ -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 || {};
},