Repository navigation
[18.0][FIX] document_page_approval: 'Cancel' button visible for any user in draft, and in any state for owners/approvers - #656
Open
miquelrosell99 wants to merge 1 commit into
Conversation
…for owner or approver
The button combined its clauses with 'and', so it was visible whenever
the user was owner or approver, in any state (including 'approved' and
'cancelled'), and also for any user while the state was 'draft' or
'to approve'.
Match the documented intent ("cancel if i am owner or approver"): the
button is now shown to owners or approvers while the revision is draft
or to approve.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Same defect pattern as #655, in the Cancel button of the history form view:
invisible="(not am_i_owner or not am_i_approver) and (state not in ('draft', 'to approve'))"Because the clauses are combined with
and, the button is visible:draftorto approve(the user condition collapses), andapprovedandcancelled(the state condition collapses).Fix
Match the documented intent ("cancel if i am owner or approver"):
invisible="(not am_i_owner and not am_i_approver) or state not in ('draft', 'to approve')"The button now shows only to owners or approvers, while the revision is
draftorto approve. Note thataction_cancel()itself performs no state or permission check, so this button is the only gate — with the old expression anyone opening a draft change request created by someone else could cancel it.