Removing "Create" button for Author

5 posts by 3 authors in: Forums > CMS Builder
Last Post: November 28, 2014   (RSS)

By northernpenguin - November 14, 2014

I would like to be able to remove the "create" button for the Author type user account.  In other words, remove the capability for Author accounts to create new records.

Any ideas?

--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke

By Damon - November 21, 2014

Hi,

What about just limiting Authors to a maximum number of records for each section?

They will then get an error message when they try to create an additional record if they have reached their maximum.

Cheers,
Damon Edis - interactivetools.com

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

By northernpenguin - November 22, 2014

Damon:  Actually, my requirements are twofold:

1.  Allow only Authors to edit specific fields in a record; and

2.  No one can create a new record except for Editors.

I can do 1. easily enough by restricting access to the specific field(s) only to Authors, but my issue is 2.  Not sure how to go about it.

Ragi

--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke

By Dave - November 27, 2014

Hi Ragi, 

Here's a simple plugin that disables "Create" for authors:

<?php
/*
Plugin Name: Disable Create for Authors
Description:
Version: 1.00
Requires at least: 2.60
*/

// register callbacks
addAction('section_init', 'disableCreateForAuthors', null, 2);

// disable Add/Create if user is an author
function disableCreateForAuthors($tableName, $action) {

  if ($GLOBALS['hasAuthorAccess'] && !$GLOBALS['hasEditorAccess']) { 
    $GLOBALS['schema']['_disableAdd'] = 1; 
  }

}

//eof

Let me know if that works for you!

Dave Edis - Senior Developer
interactivetools.com