How to pick up the keys Lookup data created in the User table


#1

I need to create a user-level to see if the User can view some of the API buttons and thought with lookup_key would be the most productive way but I am not managing to grab the values of the User table. Can someone help me?


#2

UP!!!
No one has experienced this problem?


#3

Can you clarify your use case? I don’t understand what you’re asking.


#4

I’m needing to create a user-level to control which users have access to a report button. I’m trying to do this with lookup_key the User table but I can not handle this lookup_key. I am using the getUser function, but without success, following my job:

     $ scope. $ on ('requestUser', function () {
       DreamFactory.api.system.getUser ({
         id: Session.info () id,.
         related: 'lookup_keys'
       }). Then (function (result) {
         var user = Session.info ()
         var lookups = _.chain (user.lookup_keys.level)
           .map (function (lookup) {
             return [lookup.name, lookup.value];
           })
           .Object ()
           .value ();
       });
     });

if you know another way to solve my problem I’m happy to help.


#5

Check the API Docs. It has a list of all the relationships that are available to the system/user call:

user_lookup_by_user_id (array[RelatedUserLookupResponse], optional): Zero or more UserLookup records that are potentially linked to this record directly,


#6

then, it was exactly where I found the getUser function but am I passing the parameters in the wrong way?


#7

what platform is this? I’m not much of a coder, but the related parameter should be included in the API call URL.