Field access to authors only

3 posts by 2 authors in: Forums > CMS Builder
Last Post: January 17, 2019   (RSS)

By robin - January 15, 2019

HI Andreas,

Setting a field to allow author access but not viewer access is not possible with the current CMS.  However you can do it with a plugin.  I've attached a simple plugin that allows you to restrict fields to authors but not viewers.

Note:
The field permission should be set to "Everyone" or they wont have access anyway.

The plugin has an array at the top that you can edit (code example just below this paragraph).  "test" and "test2" are table sections.  The sub-arrays containing "field1", "field3" etc. are field names.  Change the table section names to your desired tables and the field names to the fields you want to hide from viewers.

$GLOBALS['authorOnlyField']['tableFields'] =
    array(  'test'  => array('field1','field3'),
            'test2' => array('field2', 'field4')
         );

Hope that helps.  Please let me know any questions.  Thanks,
Robin

Robin
Programmer
interactivetools.com
Attachments:

authorOnlyFields.zip 1K

Thank you Robin

I will let you know soon

Regards

Andreas