diff --git a/resources/js/components/fieldtypes/assets/AssetsFieldtype.vue b/resources/js/components/fieldtypes/assets/AssetsFieldtype.vue index d2c9bd643c..2d6304e960 100644 --- a/resources/js/components/fieldtypes/assets/AssetsFieldtype.vue +++ b/resources/js/components/fieldtypes/assets/AssetsFieldtype.vue @@ -4,7 +4,7 @@ @@ -128,7 +129,6 @@ - @@ -344,6 +344,8 @@ export default { }, showPicker() { + if (! this.canBrowse && ! this.canUpload) return false + if (this.maxFilesReached && ! this.isFullWidth) return false if (this.maxFilesReached && (this.isInGridField || this.isInLinkField)) return false @@ -359,6 +361,14 @@ export default { return this.config.show_set_alt && ! this.isReadOnly; }, + canBrowse() { + return this.can('configure asset containers') || this.can('view '+ this.container +' assets') + }, + + canUpload() { + return this.config.allow_uploads && (this.can('configure asset containers') || this.can('upload '+ this.container +' assets')) + }, + }, events: { diff --git a/resources/js/components/roles/PermissionTree.vue b/resources/js/components/roles/PermissionTree.vue index e448079c0d..d976afa2d6 100644 --- a/resources/js/components/roles/PermissionTree.vue +++ b/resources/js/components/roles/PermissionTree.vue @@ -6,14 +6,12 @@ class="flex items-center justify-between py-2 pr-4 border-b group hover:bg-gray-100" :style="{ paddingLeft: `${16*depth}px` }" > -
+
@@ -27,7 +25,6 @@ v-if="permission.children.length" :depth="depth+1" :initial-permissions="permission.children" - :disabled="!permission.checked" />
@@ -39,7 +36,6 @@ export default { props: { initialPermissions: Array, - disabled: Boolean, depth: Number }, @@ -47,16 +43,6 @@ export default { return { permissions: this.initialPermissions } - }, - - watch: { - - disabled(disabled) { - if (disabled) { - this.permissions.map(permission => permission.checked = false); - } - } - } }