Extended User but $owner ACL not working

45 views
Skip to first unread message

Mohit Goyal

unread,
May 25, 2016, 4:48:29 AM5/25/16
to LoopbackJS
Hello everyone, I am new to Loopback framework. I need some help. I am working a project and required a custom user so i extended the default User model as user.

{
  "name": "user",
  "base": "User",
  "idInjection": false,
  "properties": {
  .
  .
  .

}

but the ACL $owner does not work for this model.

I called a function as follows:


    Role.isOwner(user,user_id,user_id,function(err,callback)) to check whether the user_id is owner. It should have return true but it returns err object with false. 

I searched in the documentation, mailing, stackoverflow etc but could not get the answer. May be i am not searching correctly. Can anyone please help ?

Regards
Mohit Goyal

Mohit Goyal

unread,
May 25, 2016, 3:52:47 PM5/25/16
to loopb...@googlegroups.com
I resolved the issue. I made a mistake of changing what owner can do hence $owner was not working properly and moreover i was using different foreign key name across the target models involved. Finally i realised my mistake. Issue has been resolved.

Regards
Mohit Goyal

--
You received this message because you are subscribed to a topic in the Google Groups "LoopbackJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/loopbackjs/YJjocvght40/unsubscribe.
To unsubscribe from this group and all its topics, send an email to loopbackjs+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loopbackjs/ef097db6-ccd2-477a-ac59-2cc641f0888b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yoann Aubry

unread,
Sep 29, 2016, 10:23:56 AM9/29/16
to LoopbackJS
I have a similar problem with a customUser class who extends User build-in class

With node-inspector i have found that  modelClass.prototype instanceof User doesn't work in the IsUserClass function.
Reply all
Reply to author
Forward
0 new messages