mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-28 10:49:41 +02:00
initial commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
async function ContactbookAftersave(request) {
|
||||
/* In beforesave or aftersave if you want to check if an object is being inserted or updated
|
||||
you can check as follows */
|
||||
if (!request.original) {
|
||||
const user = request.user;
|
||||
const object = request.object;
|
||||
|
||||
// Retrieve the current ACL
|
||||
const acl = new Parse.ACL();
|
||||
|
||||
// Ensure the current user has read access
|
||||
if (acl) {
|
||||
acl.setReadAccess(user, true);
|
||||
acl.setWriteAccess(user, true);
|
||||
acl.setReadAccess(object.get('UserId'), true);
|
||||
acl.setWriteAccess(object.get('UserId'), true);
|
||||
|
||||
object.setACL(acl);
|
||||
// Continue saving the object
|
||||
return object.save(null, { useMasterKey: true });
|
||||
}
|
||||
} else {
|
||||
console.log('Object being update');
|
||||
}
|
||||
}
|
||||
export default ContactbookAftersave;
|
||||
Reference in New Issue
Block a user