Skip to content

CLP needs an API #583

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

Closed
oallouch opened this issue Jun 14, 2018 · 4 comments · Fixed by #960
Closed

CLP needs an API #583

oallouch opened this issue Jun 14, 2018 · 4 comments · Fixed by #960
Labels
type:feature New feature or improvement of existing feature
Milestone

Comments

@oallouch
Copy link
Contributor

Hi,
CLP is an amazing feature, but without an easy API to set it, I can't use it. It's too easy to forget to check the dashboard.
I don't know which form it can take (is it Schema-related ?), but I'm sure you'll figure it out.

What do you think about it ?

Thx,
Olivier

@flovilmart
Copy link
Contributor

It makes sense, a masterKey only API on the SCHEMA would be nice.

@mullwaden
Copy link

Would be very nice! Currently I do something like this in lieu of a proper API:

const setCLP = ({ className, clp }) => {
  if (!clp) {
    return Promise.resolve();
  }

  // this approach is used by the dashboard.
  // see: https://github.com/parse-community/parse-dashboard/blob/master/src/lib/stores/SchemaStore.js
  return Parse._request(
    'PUT',
    'schemas/' + className,
    { classLevelPermissions: clp },
    { useMasterKey: true }
  );
};

Where the clp object is defined something like:

    clp: {
      get: { requiresAuthentication: true },
      find: {},
      create: { '*': true },
      update: { requiresAuthentication: true },
      delete: {},
      addField: {},
    },

@kosssi
Copy link

kosssi commented Jan 15, 2019

@mullwaden I don't understand how I can set good CLP with your function I would like to make this:

capture d ecran 2019-01-15 a 23 22 42

Can you describe clp object for this example?

@dplewis dplewis added help wanted type:feature New feature or improvement of existing feature labels Mar 21, 2019
@dplewis dplewis added this to the 2.4.0 milestone Mar 26, 2019
@oallouch
Copy link
Contributor Author

I really like the new protectedFields CLP.
It would still be great to have it in a future CPL API :)

dplewis added a commit that referenced this issue Oct 15, 2019
dplewis added a commit that referenced this issue Oct 16, 2019
* Set Class Level Permission via Parse.Schema

Closes: #583

* Add test cases for invalid clp

* more tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or improvement of existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants