Page 1 of 1

dashboard permissions

PostPosted: Sun Mar 18, 2012 10:31 am
by samhans
hai Steve and all friends ,
my problem is now in dashboard permissions. i have made a dashboard as given in the wiki . but when i set the permissions of the dashboard to admin , still.then every body could see the dashboard.

help me, i want that peoples must log in before they can see the dashboard.

Re: dashboard permissions

PostPosted: Mon Mar 19, 2012 2:23 pm
by shannah
How are you setting the permissions to admin?

Re: dashboard permissions

PostPosted: Tue Mar 20, 2012 7:33 am
by samhans
i have set permissions=edit in action.ini file in my table folder.

Re: dashboard permissions

PostPosted: Tue Mar 20, 2012 12:47 pm
by shannah
1. Should be actions.ini not action.ini
2. Setting permission=edit in an action definition is only half your solution. That says that the user can only see this action if they have the xyz permission granted in the current context. If the user can access the action still, that means that they are granted the xyz permission in the given context.
3. Best to place the actions.ini in the root directory. Consider that unless you have otherwise limited it, your action could be used with any table or any context. I.e. If you only want your action to work for one table, check inside the action to make sure that that table is currently selected and throw an exception if it is not.
e.g.
Code: Select all
$app = Dataface_Application::getInstance();
$query = $app->getQuery();
if ( $query['-table'] != 'mytable' ) throw new Exception("This action is only for use in the mytable table.");


-Steve