1.2releasedAuthor Roles

Add Roles to Symphony

Clone URLhttps://github.com/TwistedInteractive/author_roles.git

Add as a submodulegit submodule add https://github.com/TwistedInteractive/author_roles.git extensions/author_roles --recursive

Compatibility

2.x.x2.1.x2.2.x2.3.x2.4.x2.5.x2.6.02.6.12.6.22.6.32.6.42.6.52.6.62.6.72.6.82.6.92.6.102.6.11
NoNo1.01.2NoNoNoNoNoNoNoNoNoNoNoNoNoNo. Soon?

Readme

Author Roles

Author: Twisted Interactive
Website: http://www.twisted.nl

What does this extension do?

In short: this extension allows you to set permissions for each author with roles. It is the successor of the Author Section extension.

More detailed: The extension allows you to set the following permissions:

  • Show or hide certain sections
  • Set the rights for each section to create, edit or delete entries
  • Hide fields on certain sections
  • Let the author only see their own created entries
  • Show or hide certain entries on the publish page of sections
  • Hide menu items created by other extensions

How does it work?

Under the System-tab you see a new item 'Author Roles'. This is where you can manage your author roles. You can create as many roles as you want, and asign a role to multiple authors.

When you create a role you can set the permission for each section, by using the checkboxes. By clicking 'edit' underneath 'Fields' you can select which fields should be hidden for this section.

By clicking 'edit' underneath 'Entries' you can set various permissions. You can set if the author is only allowed to see the entries he/she created, and you can set a filter. The filter works quite easy actually. First you choose if the filter is to show or hide certain entries. In the textfield you can on or more ID's of entries. You can also set a range of ID's by using a hyphen.

Important sidenote for hiding menu items created by other extensions

Since extensions can not (yet) influence the execution order of extensions in Symphony, you need to apply a tiny little 'hack' to Symphony to make sure the 'Author Roles'-extension is executed as last, after all other extensions have made their possible modifications to the navigation. To do this, you need to edit lib/toolkit/class.extensionmanager.php and look at the SQL-query in the __construct()-function for this line:

ORDER BY t2.delegate, t1.name

and change it to:

ORDER BY t2.delegate, t1.id ASC

This makes the execution order of extensions ordered by ID instead of name. Now, if you added this extension as last to your list, you're safe now, otherwise you have to go into the database, look for the sym_extensions-table, write down the ID, and update the ID to be the highest number in the table. Don't change the other extensions! After that, edit the sym_extensions_delegates-table and change the rows which have extension_id set to the old ID, and update them to the new ID. Now everything should work just fine!

Sidenotes

  • Fields that are set to 'hidden' will be made hidden with JavaScript. This is to ensure that all the data gets send and stored on a POST-action when an entry is saved. However, this could cause some issues with third-party field-types, although these aren't encountered yet.
  • Fields that are required cannot be set to 'hidden', since that would cause an error when trying to store the entry.
  • If you choose to filter entries (by letting an author only show his/her own entries or using the filter), pagination on the publish pages is disabled. This has to be done, because Symphony doesn't have a hook to alter the query used to retreive the entries.

Version history

Requires Symphony 2.3

Added functionality to hide menu elements created by other extensions. Important: Since extensions can not (yet) influence the execution order of extensions in Symphony, you need to apply a tiny little 'hack' to Symphony to make sure the 'Author Roles'-extension is executed as last, after all other extensions have made their possible modifications to the navigation. Read the readme for more details.

Requires Symphony 2.3

Symphony 2.2 to 2.2.5