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

Update editingIsDisabled conditions #265

Merged
merged 8 commits into from
Jul 20, 2023

Conversation

jeffdaley
Copy link
Contributor

@jeffdaley jeffdaley commented Jul 19, 2023

Updates the front-end editing conditions to match the back end. Here's where things currently stand:

CleanShot 2023-07-19 at 18 12 23@2x

We'll likely tweak these permissions further (e.g., to include "view" access for approvers and stakeholders), but that will be handled separately.


TODO: Write permissions-based tests.

@@ -125,7 +125,7 @@

<div class="flex flex-col items-start space-y-2">
<Document::Sidebar::SectionHeader @title="Product/Area" />
{{#if this.isDraft}}
{{#if (and this.isDraft this.userHasEditPrivileges)}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tightening this now that we have the concept of Shareable Drafts (#261)

// true is the doc is a draft/in review/approved and the user is not an owner, contributor, or approver
return !this.userHasEditPrivileges;
} else if (this.docIsInReview || this.docIsApproved) {
return !this.isOwner;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important to note: This method is called editingIsDisabled.

@jeffdaley jeffdaley marked this pull request as ready for review July 20, 2023 20:00
@jeffdaley jeffdaley requested a review from a team as a code owner July 20, 2023 20:00
@jeffdaley jeffdaley merged commit d2241f9 into main Jul 20, 2023
1 check passed
@jeffdaley jeffdaley deleted the jeffdaley/related-resources-permissions branch July 20, 2023 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants