This topic is locked

Country Wise Security

12/16/2010 12:52:39 AM
PHPRunner General questions
M
musthafa author

I have a multi country site in which I need to set the CMS as only country specific and then user specific detail should get displayed
Sample db:
admin: ( admin_id [pk], user_name , password )

countries: ( country_iso [pk], country_name )

pages ( page_id [pk], title, body, admin_id[fk from admin table], country_iso[fk from country table] )
whenever an admin log in to CMS, he should get only his pages and when adding the page, admin_id field should be a disabled textbox with admin_id
thanks in advance.

A
ann 12/17/2010

Musthafa,
proceed to the Securitytab, click Advanced security settings button and choose Users can see and edit their own data only option.

Choose admin_id as OwnerID here.

To make the field be disabled proceed to the Visual Editor tab, open Edit as settings dialog and set up the field as Readonly.

M
musthafa author 12/26/2010

if I have a page category as a parent table for Pages, Can I restrict the admin to use a particular page category?
table : page_categories (page_category_id, category_name)

table: pages (page_id, page_category_id, admin_id , content)
any hope ?

J
Jane 12/27/2010

Unfortunately you can't use fields from other tables as OwnerID.

As workaround you can filter records manually in the List page: Before SQL query event on the Eventstab.

Select page_category_idvalues from pagestable for current admin_idvalue and add WHERE statement:

$strWhereClause = where($strWhereClause,"page_category_id in (".$_SESSION["list"].")");



where $_SESSION["list"] contains list of values from pagestable. You should fill this variable manually.