Closed
Description
I just did some dirty tests where I have a Cloud Function that initially does following:
- Creates a superuser
- Creates superuser role that can only be modified by the superuser
- Adds the superuser to the superuser role
- Creates an admin role that can only be modified by the superuser role
- Adds the superuser role to the admin role (superusers have the same rights as admins)
- Creates a customer role that can only be modified by the superuser role
- Adds the admin role to the customer role (admins have the same rights as customers)
(For testing purposes I have all this wrapped into this ugly spaghetti code
I also have a Class of Product and a beforeSave Hook that adds
setPublicReadAccess(true);
and
productACL.setRoleWriteAccess("admin", true);
to each product that is saved.
In my DB it seems that everything is setup properly:
Product:
{
"_id": "6w74MRh8Kr",
"_rperm": [
"*"
],
"_wperm": [
"role:admin"
],
...
}
_User
{
"_id": "GtYEf8IUE2",
...
}
Role
{
"_id": "ipvDGI3CaF",
...
"name": "admin",
...
}
and
{
"_id": "9XUOMFg9eC",
...
"name": "superuser",
...
}
_Join:roles:_Role
{
"relatedId": "9XUOMFg9eC",
"owningId": "ipvDGI3CaF"
}
_Join:users:_Role
{
"relatedId": "GtYEf8IUE2",
"owningId": "9XUOMFg9eC"
}
When I now login as this superuser, I can't update a Product even though the superuser role is a child of admin and should have ALL the admin rights which include write permission to Product.
(According to this doc https://parse.com/docs/js/guide#roles-role-hierarchy)
Metadata
Metadata
Assignees
Labels
No labels