Posted by cYu on February 19, 2009 at 7:42pm
| Project: | Content Construction Kit (CCK) |
| Version: | 6.x-2.x-dev |
| Component: | General |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Issue Summary
Workflow Fields module has a nice feature where 'view' permission on a field allows a user to see but not edit that field's value on the node edit screen. There is config for the preferred behavior, hiding 'view' fields on edit or showing them as read only. This would be a nice feature to add to content permissions as well.
Comments
#1
True, but it requires that widgets consistently support a 'disabled' state, which they currently do not.
#2
I can't get the issue searching to work for me as I'd expect, but do you know if there is already an issue that addresses having a standard for disabled? What about displaying as it would normally display on the view page as the default?
#3
"displaying as it would normally display on the view page" would probably work.
Very little time to work on this myself right now, though.
#4
Here is a patch adding the functionality I've described. I first started tinkering around in the content_field_form() function in content.node_form.inc but didn't want to alter the functionality there and also wanted something I could break out into a separate module in case this does not get applied to D6 CCK. I think I've taken a reasonable approach in modifying content_permissions.module and have also done it in a way which could expand to acknowledge a 'disabled' state from widgets and use that as opposed to the 'view' state.
#5
Is this still active? I'm using the 6.x.-3.x-dev version and added the patch. Seems to be working fine. Nice little added feature...very useful for an Events site I'm putting together where the event coordinator edits some fields (time, date, location, id, etc.) and the presenter edits others. This is much more useful than forcing the presenter to see it in the View screen.
#6
1) We need to use content_access(). Note that content_permissions is not the only one that implements hook_field_access().
2) When CCK uses content_access() in the node edit form, it sets the #access attribute of the form element to FALSE. This affects other modules such as fieldgroup and others that behave differently depending on the #access attribute of fields. This is because everyone assumes the field won't be rendered in the node edit form if #access is FALSE. And... this also affects Multigroups. I wonder how many other modules would be broken if we render fields even when #access = FALSE.
So... this is not as easy as it seems.