Page 1 of 1

Hiding Tabs in Views

PostPosted: Tue Mar 10, 2009 7:10 am
by andperry
I am using a number of mySQL views in addition to the actual tables. Within these views I would like to disable some of the standard buttons such as 'Delete' and 'New Record'. I'm not sure whether permissions is quite the right approach as I am not actually trying restrict privileges to users.

It is simply a case that some functions don't make sense in the given context. For example there is a view that displays the data from two tables using an inner join. Anyone with access to the database should be able to insert and delete records within the two tables individually, but together not via the combined view.

What is the easiest way of approaching this problem?

Thanks,

Andrew.

PostPosted: Wed Mar 11, 2009 8:42 am
by shannah
Permissions are probably the best way to handle this.

Code: Select all
function getRoles(&$record){
    return 'READ ONLY';
}

PostPosted: Wed Mar 11, 2009 1:41 pm
by andperry
Hi Steve,

Many thanks. Defined a new custom role in permissions.ini and it all works fine.

Thanks,

Andrew.