[WIP] fix user can comment in private assembly even if user don't have permissions#4893
[WIP] fix user can comment in private assembly even if user don't have permissions#4893isaacmg410 wants to merge 3 commits intomasterfrom
Conversation
|
I have created a new method in For now, the problem is that there is no way to receive the user by context in order to check if he has permission to participate in that specific ParticipatorySpace (in that case, Assembly Private and Transparent). Right now, I am only working with Meetings, but it will have to be extended to Proposals, Posts, etc., @decidim/lot-core Can someone help me, to understand what I'm doing wrong please? Or give me some directions to be follow with GraphQl and React, please? |
|
@isaacmg410 I don't understand what problem are you facing. Can't you use |
|
@mrcasals I have not found the way in how to get, obj and ctx. So I ask for help to know what I'm doing wrong. Can we speak offline next Monday and review it? |
| end | ||
|
|
||
| field :userCanComment, !types.Boolean, "Check if the current user can comment" do | ||
| resolve lambda { |obj, _args, ctx| |
There was a problem hiding this comment.
@mrcasals I have created this field. The problem is that I overwrite the method user_can_comment?(user) for example meetings, and I try to pass the user without success... And comments doesn't load...
There was a problem hiding this comment.
Can't you just do something like?
obj.commentable? && obj.can_participate?(ctx[:current_user])
There was a problem hiding this comment.
This is what I have already solved, in another branch. I will create a new PR today and close this one.
The question now is that I do not have any idea on how to solve and render the comment to the public side. Any idea?
There was a problem hiding this comment.
The question now is that I do not have any idea on how to solve and render the comment to the public side. Any idea?
I don't understand this, aren't the comments already rendered?
4f51a4a to
379a784
Compare
|
Close in favour of #4924 |
🎩 What? Why?
This PR fixes that as a normal user (no private user) I can comment on a private assembly where is available. Meetigns, Proposals, etc.
📌 Related Issues
📋 Subtasks
CHANGELOGentry📷 Screenshots (optional)