Managing fields display and type depending on permissions
Posted: Tue Dec 23, 2008 10:10 am
Hello again Sorry to bother you again
Now I've got a little more complicated problem, but I'm sure there is a simple solution with Xataface: I need to be able to change the way some fields display (and their type) depending on the permissions the user got.
In this system I use an external permission manager. All I need to know is how and where I can programmatically manage the display of these fields ? I've seen in the doc the functions %fieldname%__htmlValue(&$record) and %fieldname%__display(&$record) but I don't know how to use them, and from my own searches on the forum, it looks like it's not for what I intend to do.
Just a remark: I don't want to restrict the use of these fields depending on permissions (I already done that with %fieldname%__permissions(&$record) ;p),
what I want to do is to change the type from, for example, a select to a hidden field and fill the field automatically for the user, because he hasn't the right to do so (I know I can use a BeforeSave trigger, but at least I need to hide this field !).
Thank you very much in advance
Now I've got a little more complicated problem, but I'm sure there is a simple solution with Xataface: I need to be able to change the way some fields display (and their type) depending on the permissions the user got.
In this system I use an external permission manager. All I need to know is how and where I can programmatically manage the display of these fields ? I've seen in the doc the functions %fieldname%__htmlValue(&$record) and %fieldname%__display(&$record) but I don't know how to use them, and from my own searches on the forum, it looks like it's not for what I intend to do.
Just a remark: I don't want to restrict the use of these fields depending on permissions (I already done that with %fieldname%__permissions(&$record) ;p),
what I want to do is to change the type from, for example, a select to a hidden field and fill the field automatically for the user, because he hasn't the right to do so (I know I can use a BeforeSave trigger, but at least I need to hide this field !).
Thank you very much in advance