<div dir="ltr">Yes. Could you please also explain how maintainers and importers play different role?</div><br><div class="gmail_quote"><div dir="ltr">On Thu, May 17, 2018 at 11:00 PM Paolo Bonzini <<a href="mailto:pbonzini@redhat.com" target="_blank">pbonzini@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 17/05/2018 19:25, Shubham Jain wrote:<br>
>     > +        if request.user.is_superuser or 'importers' in<br>
>     user_group_names:<br>
>     > +            projects = [p for p in Project.objects.all() if<br>
>     p.recognizes(m)]<br>
>     > +        else:<br>
>     > +            projects =  [p for p in Project.objects.all() if<br>
>     p.maintained_by(self.request.user)]<br>
> <br>
>     I think the else branch should still union the p.recognizes() filtering.<br>
> <br>
> As you have mentioned in the test case below<br>
> "test_maintainer_of_project_x_import_a_patch_to_project_y()", does this<br>
> mean even if user is maintainer of one project, but result in message is<br>
> simply imported to all the recognised project. If yes, why are we just<br>
> not using only recognised condition? <br>
<br>
The idea is that if a user wants to import to a particular project he<br>
maintains, he uses /projects/.../messages.  If a user wants to recognize<br>
the projects based on the recipients, he uses /messages.<br>
<br>
(In practice the former happens rarely, but it was already complicated<br>
enough and it makes sense to have it as part of the REST API!)<br>
<br>
Does it make sense?<br>
<br>
Paolo<br>
</blockquote></div>