Page 1 of 1

Lookup table not working

Posted: Mon Jan 15, 2018 6:40 pm
by cdmak

Hello,

I have a editable view and in this view is a lookup table that accesses the users table, I'm filtering the userlevels table "access_level = '1'" so I only get those users in the "1" permissions group. If i'm logged in as admin the records populate in the Modal Dialog for lookup but if I'm logged in as a none admin user the modal lookup say no records found and only gives me only my user account in the lookup like it is using my userID for the lookup and it is not set to do that.. I think I ran into a big snag. Hope it's something simple.

Thanks.


Re: Lookup table not working

Posted: Mon Jan 15, 2018 6:54 pm
by kirondedshem

The user and userlevel tables normally have security constraints from phpmaker, so It might be that they still go as far as tracking it even in lookup table, Whta i always do is create another view out of the user account table containing user id and names, then use that for my lookups evrywhere.
for example
CREATE VIEW vw_user_account AS select id , concat_ws(' ',ifnull(first_name,''),ifnull(sir_name,'')) AS name,username, uswr_group_id from user_account;

then I use this for lookup.

Even when I need to allow other none admin users to maybe add/edit user accounts, I still dont use the main table I make an editable view out of it and use that instead.


Re: Lookup table not working

Posted: Tue Jan 16, 2018 1:45 am
by cdmak

Hello kirondedshem,

Thank you I got it working with your help. Here's what I did and it works great, many thanks again!

  1. Make a new view for users.
  2. In Advanced Security I did not specify the User ID Field.
  3. Make a link in the Master/Detail users.id = user_account_lookup.id, now users can edit their own user account.

Thank You


Re: Lookup table not working

Posted: Wed Nov 18, 2020 6:37 am
by alex

Hello!

"Advanced Security - User ID" -> select checkbox "Allow View All" for table "users", regenerate table "users" (v2020).