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

Switch ACL to Relay Global Id #6495

Merged
merged 1 commit into from
Mar 23, 2020

Conversation

Moumouls
Copy link
Member

No description provided.

@Moumouls Moumouls added type:bug Impaired feature or lacking behavior that is likely assumed enhancement labels Mar 11, 2020
@Moumouls Moumouls requested a review from davimacedo March 11, 2020 17:29
@Moumouls Moumouls self-assigned this Mar 11, 2020
@codecov
Copy link

codecov bot commented Mar 11, 2020

Codecov Report

Merging #6495 into master will decrease coverage by 10.15%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #6495       +/-   ##
===========================================
- Coverage   93.92%   83.77%   -10.16%     
===========================================
  Files         169      169               
  Lines       11808    11812        +4     
===========================================
- Hits        11091     9895     -1196     
- Misses        717     1917     +1200     
Impacted Files Coverage Δ
src/GraphQL/loaders/defaultGraphQLTypes.js 97.06% <100.00%> (+0.01%) ⬆️
src/GraphQL/transformers/mutation.js 96.70% <100.00%> (+0.11%) ⬆️
...dapters/Storage/Postgres/PostgresStorageAdapter.js 2.54% <0.00%> (-94.20%) ⬇️
src/Adapters/Storage/Postgres/PostgresClient.js 6.66% <0.00%> (-80.00%) ⬇️
src/Controllers/FilesController.js 91.48% <0.00%> (-2.13%) ⬇️
src/Controllers/UserController.js 93.45% <0.00%> (-0.94%) ⬇️
src/Routers/UsersRouter.js 93.71% <0.00%> (-0.63%) ⬇️

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 35d76b8...9fa20de. Read the comment docs.

@@ -553,7 +554,7 @@ const ACL = new GraphQLObjectType({
Object.keys(p).forEach(rule => {
if (rule !== '*' && rule.indexOf('role:') !== 0) {
users.push({
userId: rule,
userId: toGlobalId('_User', rule),
Copy link
Member

Choose a reason for hiding this comment

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

Can we make to work with either Relay global id or Parse object id?

Copy link
Member Author

Choose a reason for hiding this comment

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

Its the output type, we should return only the RelayId, otherwise it would be hard in a near further to get off objectId

Copy link
Member

Choose a reason for hiding this comment

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

Sorry. My bad. You're right.

@@ -99,6 +99,10 @@ const transformers = {
}
if (value.users) {
value.users.forEach(rule => {
const globalIdObject = fromGlobalId(rule.userId);
Copy link
Member

Choose a reason for hiding this comment

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

Like here. I think here it is working with both ids.

@davimacedo davimacedo merged commit 312a4bc into parse-community:master Mar 23, 2020
@mtrezza mtrezza removed type:bug Impaired feature or lacking behavior that is likely assumed 🧬 enhancement labels Jul 11, 2021
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.

3 participants