Closed kuba-orlik closed 9 years ago
I would suggest certain corrections:
var access_strategy = new Sealious.ChipTypes.AccessStrategy({
name: "just_owner",
item_sensitive: true,
checker_function: function(context, item){
if(context.get("user_id") === item.created_context.user_id){ //belong_to_user
return Promise.resolve();
} else {
return Promise.reject("Only the owner of this resource can perform this operation on this item.");
};
}
});
I think in that form it's ready to be added to base chips
:)
Ok, I can add to base chips
in new branch.
Ok, waiting for a pull request :)
Probably we are thinking about something like this: huh?