Hiding fields of records for Editors and Authors

7 posts by 4 authors in: Forums > CMS Builder
Last Post: August 1, 2011   (RSS)

By Tim_cmsb - July 28, 2011

Hi,

I'm need to hide certain fields of records for the editors, because this option exsists for the Authors.
But I want all the other options to be available for the Editors, but with the possibility to hide certain fields.

Regards,

Tim

Re: [Tim_cmsb] Hiding fields of records for Editors and Authors

By Jason - July 29, 2011

Hi Tim,

There are a couple of options.

If you upgrade to the newest version of CMS Builder (http://www.interactivetools.com/upgrade) you can edit a field and under "Advanced Options" set a field to be viewable only to Editors.

Another options would be to use a free plugin that can hide fields based on certain user settings:
http://www.interactivetools.com/add-ons/detail.php?Show-Hide-Fields-For-Users-1036
This plugin does require some extra work to integrate, so the first option is probably the easiest.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Hiding fields of records for Editors and Authors

By Tim_cmsb - July 30, 2011

Hi Jason,

I need to hide fields from the editors!!!!!
Where can I find information about the plugin?

I tried the following, but didin't go well....!!!!
I have hidden 2 fields from the Editors as follows, but I'am getting shifts and problems in the program.
See attachments.
Can you guys help me with this????

I made the changes according to the CMS Builder Cookbook!!!
This is explained under: "HIDING FIELDS FROM SECTION EDITORS BUT NOT FROM ADMINS".

Had to do the following:

Open /cmsAdmin/lib/menus/default/edit_functions.php
- Search for:

_____ code ________________________________________________

!$CURRENT_USER['isAdmin'] && !$GLOBALS['hasEditorAccess']

__________________________________________________________

and remove the && !$GLOBALS['hasEditorAccess'] code:
if (@$fieldHash['adminOnly'] && !$CURRENT_USER['isAdmin'] && !$GLOBALS['hasEditorAccess']) { continue; } // skip admin only fields

__________________________________________________________

- Open /cmsAdmin/lib/menus/default/save.php
- Search for:

_____ code ________________________________________________

!$CURRENT_USER['isAdmin'] && !$GLOBALS['hasEditorAccess']

__________________________________________________________

and remove the && !$GLOBALS['hasEditorAccess'] code (from two lines):

_____ code ________________________________________________

if (@$fieldSchema['adminOnly'] && !$CURRENT_USER['isAdmin'] && !$GLOBALS['hasEditorAccess']) { continue; } // skip admin only fields
if (@$fieldSchema['adminOnly'] && !$CURRENT_USER['isAdmin'] && !$GLOBALS['hasEditorAccess'] ) { continue; } // skip admin only fields

I'm using IE 9 and FireFox 3.

Regards,

Tim

Re: [Tim_cmsb] Hiding fields of records for Editors and Authors

By robin - August 1, 2011

Hey Tim,

Something that might be easier for you. If you have the latest CMS Builder, you can set a field to "Admin Only" and it will hide from editors in the view/edit screen.

Hope that helps,
Robin
Robin
Programmer
interactivetools.com

Re: [Damon] Hiding fields of records for Editors and Authors

By Tim_cmsb - August 1, 2011

Hi Damon,

OK, but will all the settings and records stay OK?

Tim

Re: [Tim_cmsb] Hiding fields of records for Editors and Authors

By Damon - August 1, 2011

Hi,

>OK, but will all the settings and records stay OK?

Yes everything will stay the same, except only users that you have allowed access to that field will see it.

To test, open and login into CMS Builder using a different browser and with a user account that doesn't have access to that field. Then you can confirm the field is not available for that user level.
Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/