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

Expose canCreate flags for Comments #3305

Merged
merged 3 commits into from
Oct 9, 2024
Merged

Conversation

CarsonF
Copy link
Member

@CarsonF CarsonF commented Oct 8, 2024

Currently the comments canCreate just points to threads canCreate. I think this is fine, until it's not.
It's probable that we'd want to simplify and remove threads from authorization, since they just group comments.
But first we'd need to do the policy refactor for embedded resources

- r.X.children(c => c.comments...)
+ r.Comment.for('X')...

https://seed-company-squad.monday.com/boards/3451697530/pulses/7124883698

@CarsonF CarsonF force-pushed the commentable-can-create branch from 96fe99b to 0cce117 Compare October 8, 2024 14:16
Copy link

github-actions bot commented Oct 8, 2024

🗞 GraphQL Summary

View schema changes
@@ -255,9 +255,17 @@
   id: ID!
   modifiedAt: DateTime!
 }
 
-type CommentList implements PaginatedList {
+type CommentList implements PaginatedList & Secured {
+  """
+  Whether the current user can add items to this list via the appropriate mutation
+  """
+  canCreate: Boolean!
+
+  """Whether the current user can read the list of items"""
+  canRead: Boolean!
+
   """Whether the next page exists"""
   hasMore: Boolean!
 
   """
@@ -305,9 +313,17 @@
   ): Comment
   parent: Commentable!
 }
 
-type CommentThreadList implements PaginatedList {
+type CommentThreadList implements PaginatedList & Secured {
+  """
+  Whether the current user can add items to this list via the appropriate mutation
+  """
+  canCreate: Boolean!
+
+  """Whether the current user can read the list of items"""
+  canRead: Boolean!
+
   """Whether the next page exists"""
   hasMore: Boolean!
 
   """

⚠️ Dangerous Changes

  • Secured added to interfaces implemented by CommentList.
  • Secured added to interfaces implemented by CommentThreadList.

Copy link
Contributor

@rdonigian rdonigian left a comment

Choose a reason for hiding this comment

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

Had a question on the removing all of the awaits, but now understand that this is part of lingering tech debt. Otherwise, LGTM!

@CarsonF CarsonF merged commit b7eba35 into develop Oct 9, 2024
15 checks passed
@CarsonF CarsonF deleted the commentable-can-create branch October 9, 2024 13:22
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.

2 participants