Page 1 of 1

Need help on data level security

Posted: 2016-02-22 08:03
by user8409
Hi,

I have a situation where admin will be loading all the users into application for ex: students data.
How to assign individual students to their own record. I do not see any option to do this in Admin area.

Another situation:

I've a product Category table populating through my application, where as Product price list I'm loading through insert command at // hook: Product_Price_list_after_insert.

How to assign owner to the records in Product Price List.

appreciate your help in advance
Thanks,

Re: Need help on data level security

Posted: 2016-02-23 04:47
by a.gneady
To assign and owner to multiple records, please see this thread: http://forums.appgini.com/phpbb/viewtop ... f=4&t=1976

To programmatically assign owner of a record that you inserted through hooks into a table that we'll name "sales_items" for example:

Code: Select all

$last_id = makeSafe(db_insert_id());
$user = makeSafe($_SESSSION['memberID']);
$group = sqlValue("select groupID from membership_users where memberID='$user'");
$ts = time();
sql("insert into membership_userrecords set tableName='sales_items', pkValue='$last_id', memberID='$user', dateAdded='$ts', groupID='$group'", $eo);