As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
Hi, I'm looking for the proper way to see if the current user can edit an entity. I've come up with:
~~~
var user = Kinvey.getActiveUser();
if(user._id === entity._acl.creator){
//user is owner
}
~~~
But I'm guessing this won't work if there are user groups or reader/writer lists. Is there a method available to determine what permission level a user has for an entity?
`new Kinvey.Acl(entity).getCreator()` returns the same as entity._acl.creator, so I'm assuming that if I want to get anyone who is the creator or a writer for the entity, I'll need to do both `getCreator()` and `getWriters()` for the entity. Either that or add the creator as a writer.
M
Mark
said
over 9 years ago
That would work yes. However, if the user is part of a group that has read/write access, there is no way to check write access without actually firing the request.
adampax
~~~
var user = Kinvey.getActiveUser();
if(user._id === entity._acl.creator){
//user is owner
}
~~~
But I'm guessing this won't work if there are user groups or reader/writer lists. Is there a method available to determine what permission level a user has for an entity?
Titanium v 1.1.8
Thanks