Skip to content

Add Parse.CLP Object to control ClassLevelPermissions #1145

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

Merged

Conversation

brunocosta91
Copy link
Contributor

The intent of this pull request is to provide the Parse.CLP object which could be use later to be returned on Parse.Schema.
Currently is possible create a new Parse.CLP(schema.classLevelPermissions) and check permissios of user/role/public.

@codecov
Copy link

codecov bot commented Apr 10, 2020

Codecov Report

Merging #1145 (1a47a78) into master (88d4ecd) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            master     #1145    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           57        58     +1     
  Lines         5434      5645   +211     
  Branches      1219      1267    +48     
==========================================
+ Hits          5434      5645   +211     
Impacted Files Coverage Δ
src/Parse.js 100.00% <100.00%> (ø)
src/ParseCLP.js 100.00% <100.00%> (ø)
src/ParseSchema.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 88d4ecd...1a47a78. Read the comment docs.

@JeromeDeLeon
Copy link
Contributor

This is very useful IMO. We had to manually do this ourselves.

@brunocosta91
Copy link
Contributor Author

I found this problem to check permissions on CLP so i decide share my solutions, this is based on ACL.
Just to sumarize my approach (similar to basic vs advanced on parse-dashboard):
write access = update && create && delete && addField access
read access = find && count && get access

Copy link
Contributor

@JeromeDeLeon JeromeDeLeon left a comment

Choose a reason for hiding this comment

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

Haven't look it up thoroughly.

@dplewis dplewis requested review from acinader and davimacedo April 14, 2020 15:25
@davimacedo
Copy link
Member

@brunocosta91 thanks for the PR. It is a great job! I have some questions:

  • Would it be possible to also support requiresAuthentication and pointer permissions? @dplewis @acinader am I missing something else?
  • Could you provide an example on how it will integrate with the other functions we have here in the SDK? I mean, how would we use the ParseCLP object and setup the CLP of a certain class?
  • Could you please increase the test coverage? Only 50% of the ParseCLP.js file is currently covered.
  • It would be greate to also have a PR to the JS Docs explaining how to use it.

@acinader
Copy link
Contributor

@davimacedo looks good to me.

@brunocosta91
Copy link
Contributor Author

This weekend I will add more test and try improve PR with suggestions by @davimacedo

@dplewis
Copy link
Member

dplewis commented Aug 17, 2020

@brunocosta91 Any updates on this? It would be awesome to include this in the SDK. Let us know if you need assistance.

@brunocosta91
Copy link
Contributor Author

I will try get some time to improve this PR

@dplewis
Copy link
Member

dplewis commented Jan 7, 2021

@brunocosta91 I can finish this PR up for you. I just need write access to your fork. This is an amazing feature!

@dplewis dplewis requested a review from mtrezza January 8, 2021 17:49
@dplewis
Copy link
Member

dplewis commented Jan 8, 2021

@davimacedo @mtrezza I believe this is ready for review.

Copy link
Member

@davimacedo davimacedo left a comment

Choose a reason for hiding this comment

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

LGTM!

@dplewis dplewis merged commit a0b2561 into parse-community:master Jan 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.

5 participants