Page 1 of 1

Dropdown Filter only own data? How.

Posted: 2014-03-17 12:54
by preditor
Hi There. Can someone help me with this? I need to get help on this query. A want to show only owned data form a dropdown box. Now it shows all record from every user in it but i need to let is show only the data to the user how insert the data.

This is the Advaced lookup option box:

Code: Select all

SELECT `mc_werknemers`.`ID`, `mc_werknemers`.`mc_naam` FROM `mc_werknemers` LEFT JOIN `config_veld_functie` as config_veld_functie1 ON `config_veld_functie1`.`ID`=`mc_werknemers`.`mc_functie` LEFT JOIN `config_veld_contract` as config_veld_contract1 ON `config_veld_contract1`.`ID`=`mc_werknemers`.`mc_contract` ORDER BY 2
All the data from the name field is shown, but i'm logged is as a "username" and it show all data in the drupbox form alle users. Now i did try this like the coding here :

Code: Select all

SELECT `mc_werknemers`.`ID`, `mc_werknemers`.`mc_naam` FROM `mc_werknemers` LEFT JOIN `config_veld_functie` as config_veld_functie1 ON `config_veld_functie1`.`ID`=`mc_werknemers`.`mc_functie` LEFT JOIN `config_veld_contract` as config_veld_contract1 ON `config_veld_contract1`.`ID`=`mc_werknemers`.`mc_contract` WHERE `membership_users`.`memberID`=`mc_werknemers`.`mc_ingevoerd_door` ORDER BY 2
Please advice!
THanks you

Re: Dropdown Filter only own data? How.

Posted: 2014-03-18 15:56
by preditor
Please advice!

Re: Dropdown Filter only own data? How.

Posted: 2014-03-18 20:03
by a.gneady
Hmm .. you don't need to write a customized query for this purpose. You should check the option "Inherit access permissions". This will limit the contents of the dropdown to only the items the current user can access.

Re: Dropdown Filter only own data? How.

Posted: 2014-03-19 11:46
by preditor
Thank you I try this out. Thanks again. :D