View and Edit permissions for fields

Archived from the Xataface Users forum.

hhkilis — Wed Mar 21, 2012 8:10 am

Hi,

Users without necessary permissions can also edit fields which are handled under specific permissions. How can I solve this problem?

permissions.ini

Code: Select all
`[Field Viewer]
view=1

[Field Editor]
edit=1`

Users who have Field Editor role can edit fieldX, users who have Field Viewer role can view fieldX. Here Field Viewers can also change value of fieldX (a select widget is used for fieldX).

I wrote necessary permission function for fieldX in its table’s delegate class and checked that function, no problem there.


shannah — Wed Mar 21, 2012 10:39 am

Field permissions are overlaid over record permissions. They don’t override them as a set. I.e. If you return a role’s permissions in a field and it doesn’t explicitly specify certain permissions, then the omitted permissions will be just what the record returned for those permissions. I have attached a section from the unfinished Xataface manual that discusses this further and provides an example.


hhkilis — Thu Mar 22, 2012 12:40 am

Thanks for explanations and attached document. It helped a lot.

I tried the solution below, now it works.

permissions.ini

Code: Select all
`[Field Viewer]
view=1
edit=0
new=0

[Field Editor extends Field Viewer]
new=1
edit=1`


hhkilis — Thu Mar 22, 2012 1:22 am

http://xataface.com/wiki/index.php?-act … -mode=list