Hi,
I have an app that sends a json to a php mysql appgini server via post, lets say is employees data.
They have a supervisor asigned. I used appgini to model all and data coming from employees is viewable and supervisor table is also there.
Now i need to supervisors only view data asigned to them. The data posted from employees may cone with the field data.supervisorid that may match supervisor.supervisorid.
How do i add ownership to the data inyected via post to respective fields when a x supervisor enters to appgini app?
Any help is welcome!
A3
Add records ownership to supervisors
-
- Veteran Member
- Posts: 104
- Joined: 2018-12-10 21:52
-
- Veteran Member
- Posts: 104
- Joined: 2018-12-10 21:52
Re: Add records ownership to supervisors
Another thing that comes to my mind can be
1- Keep posting to the mysql the same way as today, i mean with no supervisorID (as I planned on previous post)
2- When appgini app start, seeks the eployee table top to boton to get supervisorsIDassigned field in each record of employee
3- Use gotten supervisorsIDassigned from employee and update data from POST/App and paste supervisorsIDassigned on its according records
4- Use the same way (I DONT KNOW HOT TO DO) to make when user(supervisor) logs in and navigate, just view record from POST/App that has its supervisorsIDassigned in thesupervisorsIDassigned field.
I suggest this since its easier in a way, cause this way doesnt need to update the C#/Unity app then the AppGini Code.
Really need that help, Im sure some one will come with an easy answer and im here just overthinking it...
Thanks in advance
1- Keep posting to the mysql the same way as today, i mean with no supervisorID (as I planned on previous post)
2- When appgini app start, seeks the eployee table top to boton to get supervisorsIDassigned field in each record of employee
3- Use gotten supervisorsIDassigned from employee and update data from POST/App and paste supervisorsIDassigned on its according records
4- Use the same way (I DONT KNOW HOT TO DO) to make when user(supervisor) logs in and navigate, just view record from POST/App that has its supervisorsIDassigned in thesupervisorsIDassigned field.
I suggest this since its easier in a way, cause this way doesnt need to update the C#/Unity app then the AppGini Code.
Really need that help, Im sure some one will come with an easy answer and im here just overthinking it...
Thanks in advance
-
- Veteran Member
- Posts: 104
- Joined: 2018-12-10 21:52
Re: Add records ownership to supervisors
Any advice?
-
- Veteran Member
- Posts: 104
- Joined: 2018-12-10 21:52
Re: Add records ownership to supervisors -->SOLVED<--
SOLVED! Heres HOW I worked for me:
01 Have a field with the supervisor in the data table, and obviously also in the “employeesâ€
02 Used table_INIT to get $memberInfo['username'] of logged in user
03 Used the table_INIT hoock to get where that username was on the main list of “empoyees†and make an array of it
04 Used that lovely array to navigate the “employees†table and post the name of the supervisor
05 On the data table just ad a filter based on that field to be the $memberInfo['username']
Hope it helps someone some day
01 Have a field with the supervisor in the data table, and obviously also in the “employeesâ€
02 Used table_INIT to get $memberInfo['username'] of logged in user
03 Used the table_INIT hoock to get where that username was on the main list of “empoyees†and make an array of it
04 Used that lovely array to navigate the “employees†table and post the name of the supervisor
05 On the data table just ad a filter based on that field to be the $memberInfo['username']
Hope it helps someone some day