HIDING FIELDS FROM SECTION EDITORS BUT NOT FROM ADMINS - Nov 6th, 2011


As of version 2.08, this feature was added:
Editors: Fields can now be set to "Editor only" or "Admin only"

Go to Admin > Section Editors > Your Section

Then select the field you want to change access level on and click modify.

Next, scroll to the bottom and set the Access Level.

LEGACY INFORMATION (Pre CMSB Version 2.08)

Normally when you restrict access to a field through “Advanced Options” to “Admin Only - Field can only be
modified by admin or editor user” , you get exactly that. Both Admins, and users with editor access can see and modify
the information in those fields.

Here are some code changes Dave Edis, from Interactive Tools offered to keep those fields restricted to admins only and
not available to “editor” users.

Be sure to make backups and test any changes.

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



!$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:



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



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



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



This helped me when I had a field in a “membership” section called “Founding Members” that I didn’t want to
have changed or seen by anyone other than Admins.



The materials on this web site have been created for use with CMS Builder content management software. CMS Builder software is published and licensed for use by InteractiveTools.com. Please contact Interactive Tools for information on the downloading of the software or the purchasing of licenses.


Terms of Service