Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x] Fix publish form actions permission check #10274

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions resources/js/components/entries/PublishForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
</div>
</h1>

<dropdown-list class="rtl:ml-4 ltr:mr-4" v-if="canEditBlueprint">
<dropdown-item :text="__('Edit Blueprint')" :redirect="actions.editBlueprint" />
<dropdown-list class="rtl:ml-4 ltr:mr-4" v-if="canEditBlueprint || hasItemActions">
<dropdown-item :text="__('Edit Blueprint')" v-if="canEditBlueprint" :redirect="actions.editBlueprint" />
<li class="divider" />
<data-list-inline-actions
v-if="!isCreating"
v-if="!isCreating && hasItemActions"
:item="values.id"
:url="itemActionUrl"
:actions="itemActions"
Expand Down
10 changes: 9 additions & 1 deletion resources/js/components/publish/HasActions.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default {

props: {
initialItemActions: Array,
initialItemActions: { type: Array, default: () => [] },
itemActionUrl: String,
},

Expand All @@ -11,6 +11,14 @@ export default {
}
},

computed: {

hasItemActions() {
return this.itemActions.length > 0;
},

},

methods: {

actionStarted() {
Expand Down
6 changes: 3 additions & 3 deletions resources/js/components/terms/PublishForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
</div>
</h1>

<dropdown-list class="rtl:ml-4 ltr:mr-4" v-if="canEditBlueprint">
<dropdown-item :text="__('Edit Blueprint')" :redirect="actions.editBlueprint" />
<dropdown-list class="rtl:ml-4 ltr:mr-4" v-if="canEditBlueprint || hasItemActions">
<dropdown-item :text="__('Edit Blueprint')" v-if="canEditBlueprint" :redirect="actions.editBlueprint" />
<li class="divider" />
<data-list-inline-actions
v-if="!isCreating"
v-if="!isCreating && hasItemActions"
:item="values.id"
:url="itemActionUrl"
:actions="itemActions"
Expand Down
5 changes: 3 additions & 2 deletions resources/js/components/users/PublishForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
<breadcrumb :url="cp_url('users')" :title="__('Users')" />
<div class="flex items-center">
<h1 class="flex-1" v-text="title" />
<dropdown-list class="rtl:ml-4 ltr:mr-4" v-if="canEditBlueprint">
<dropdown-item :text="__('Edit Blueprint')" :redirect="actions.editBlueprint" />
<dropdown-list class="rtl:ml-4 ltr:mr-4" v-if="canEditBlueprint || hasItemActions">
<dropdown-item :text="__('Edit Blueprint')" v-if="canEditBlueprint" :redirect="actions.editBlueprint" />
<li class="divider" />
<data-list-inline-actions
v-if="hasItemActions"
:item="values.id"
:url="itemActionUrl"
:actions="itemActions"
Expand Down
Loading