Page 1 of 1

PostPosted: Fri Jul 20, 2007 3:35 am
by Markus
Hi Steve,

i would like to make all records of one table only editable by admins not by editUsers.

So I was wondering if I could do this easyly in my tables actions.ini or do i have to write a function in my tables DelegateClass anyway?

I looked at the action [edit] in actions.ini of DF copied this piece to my tables actions.ini and it looks like this:

;; Edit the details of the current record.
[edit]
label = Edit
url = "{$this->url('-action=edit&-relationship=')}"
template = Dataface_Edit_Record.html
mode = browse
category = record_tabs
selected_condition = "$query['-action'] == 'edit'"
permission = view
order=-1

So maybe I can change something here to make the records of this table only editable for Admin users?
The other way in the tables delegate class I think I can do on my own.
This was a question to just get to know a little bit more about the actions.ini

Thank you

Markus

PostPosted: Fri Jul 20, 2007 8:31 am
by shannah
The actions.ini file will allow you to specify the permission required to access a given action. In the case that you pasted in, it looks like your "edit" action requires only the "view" permission, which is not right. It should be
permission = "edit".

This won't allow you to say who has permission.. just which permission is required.

Permissions must be assigned in the application delegate class or the table delegate class.

To achieve what you want, you will want to define the getPermissions() method on that table giving all access to admins, but no access (or read only access) to the other users.

-Steve

PostPosted: Fri Jul 20, 2007 11:10 am
by Markus
Yes,
sorry because I tried some things I changed permission to view. Of course it has to be edit in this place. I think I got it.

I will then assign the Permissions in the delegate class of my table.

Thanks again and best regards

Markus