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

Fix "has same role as author" condition not working properly #8202

Merged
merged 4 commits into from Oct 8, 2020

Conversation

Convly
Copy link
Member

@Convly Convly commented Oct 6, 2020

Description of what you did:

Conditions based on author's roles were not working properly. This PR aims to fix this behaviour.

fix #8129

About the SERVER_ERROR mentionned in the issue, the backend is sending back a 403 Forbidden error.
@soupette / @HichamELBSI do you have any insight on this?

@alexandrebodin alexandrebodin added this to the 3.2.1 milestone Oct 6, 2020
@alexandrebodin alexandrebodin added source: core:content-manager Source is core/content-manager package issue: bug Issue reporting a bug labels Oct 6, 2020
@Convly Convly force-pushed the fix/has-same-role-as-author-condition branch from 9c95eb8 to 2437e6b Compare October 6, 2020 09:46
Copy link
Contributor

@petersg83 petersg83 left a comment

Choose a reason for hiding this comment

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

LGTM, waiting for some smol tests 👀

@codecov
Copy link

codecov bot commented Oct 6, 2020

Codecov Report

Merging #8202 into master will decrease coverage by 0.00%.
The diff coverage is 27.27%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8202      +/-   ##
==========================================
- Coverage   33.03%   33.03%   -0.01%     
==========================================
  Files        1219     1219              
  Lines       13563    13569       +6     
  Branches     1348     1348              
==========================================
+ Hits         4481     4482       +1     
- Misses       8200     8205       +5     
  Partials      882      882              
Flag Coverage Δ
#front 24.70% <0.00%> (-0.02%) ⬇️
#unit 54.11% <60.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...c/components/Roles/ConditionsSelect/MenuList/Ul.js 66.66% <ø> (ø)
...er/admin/src/components/CustomTable/TableHeader.js 0.00% <0.00%> (ø)
...ntent-manager/admin/src/components/Search/index.js 0.00% <0.00%> (ø)
...ugin-content-manager/controllers/ContentManager.js 21.67% <0.00%> (ø)
...r/admin/src/components/ComponentSelect/MenuList.js 0.00% <ø> (ø)
...builder/admin/src/components/SelectMenuUl/index.js 0.00% <0.00%> (ø)
...in-upload/admin/src/components/InputMedia/index.js 0.00% <0.00%> (ø)
...n/services/permission/permissions-manager/index.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 43ff63c...3cce9ad. Read the comment docs.

@soupette
Copy link
Contributor

soupette commented Oct 6, 2020

#8129

Since the errors are not unified in the app it's really difficult for the front-end to process them, this is why it doesn't catch the forbidden error.

@derrickmehaffy
Copy link
Member

#8129

Since the errors are not unified in the app it's really difficult for the front-end to process them, this is why it doesn't catch the forbidden error.

This will probably be something to address in the backend and unifying/standardizing our error response (I know the U&P plugin has some issues there)

@alexandrebodin
Copy link
Member

@derrickmehaffy here we can use the status code which are standard not the best message be forbidden is better than server error :)

@alexandrebodin alexandrebodin removed this from the 3.2.1 milestone Oct 7, 2020
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
@Convly Convly force-pushed the fix/has-same-role-as-author-condition branch from 2437e6b to 7505365 Compare October 8, 2020 12:21
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug source: core:content-manager Source is core/content-manager package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug with "has same role as creator" with custom roles
5 participants