Roles, Permissions and Workflow

Feed 7 posts, 5 voices

Avatar
4 posts

Hi, I have a site build in frog where i want to give access to a person to be able to edit a page and its contents but NOT be able to publish it.

What I require is some sort of workflow, so that this person makes a change to the page and saves it in draft mode (hidden would also be good). I then can review, and publish to live.

I aussumed that the editor role might prevent a user from publishing, but it allowed me to select all statuses.

So, my question is and am I doing it wrong? or do I have to customise frog to accept a new role say ‘author’ with custome permissions?

 
Avatar
541 posts

Yep you have to customize for this !! for now role are realy basic and you can’t do what you want with the current version

 
Avatar
4 posts

Thanks, I thought the roles may have been setup for this by default.

I have now customised it with a quick IF statement, so Editors cannot publish. Will do the job :)

 
Avatar
7 posts

Hi springie,

Can you share what code and files you updated to make it work?

Thanks!
Cj

 
Avatar
4 posts

Yep, I’ll put it up soon when I get back to work. It just an If statement nothing flash.

Its good in the fact an editor cannot publish and if they edit and save a published page it will be resaved as a draft, so the administrator can check an republish.

This can also be bad too, as they can edit a published page and as it saves as a draft it dissapears from the site.

To counter this I started modding the code so that an editor will only be shown hidden pages in the page view. This works in my situation … sort of.

I am thinking the pages the I want to be edited by an external person (editor) i will copy and change the status to hidden. With the code mod above, the editor will only be able to edit the hidden copies. When a change has been made, the page status will go to Draft, then i will go in and check the code/contents, then either delete the original then rename or just copy + paste the new code in to the old page.

Does that make sense?

It not ideal but will do the job for this situation. Ideally the editor could edit all the pages and on edit would be copied automatically and set to a draft or ‘up for review’ status.

 
Avatar
4 posts

File to edit:
/frog/app/views/page/edit.php

Find this line (around line 160ish):

<option value="<?php echo Page::STATUS_PUBLISHED; ?>"<?php echo $page->status_id == Page::STATUS_PUBLISHED ? ' selected="selected"': ''; ?>><?php echo __('Published'); ?></option>

Add a dirty if around it so it looks like this:

<?php  if ( AuthUser::hasPermission('administrator') && AuthUser::hasPermission('developer')  ) {   ?>

  <option value="<?php echo Page::STATUS_PUBLISHED; ?>"<?php echo $page->status_id == Page::STATUS_PUBLISHED ? ' selected="selected"': ''; ?>><?php echo __('Published'); ?></option>

<?php } ?>

This just prevents the ‘publish’ option from being displayed to an editor role.

 
Avatar
24 posts

It works but when I log in a administrator role the publish option doesn’t show there either.

 
Avatar
1 posts

gemmasan:
Just change this line:
<?php if ( AuthUser::hasPermission(‘administrator’) && AuthUser::hasPermission(‘developer’) ) { ?>
to this:
<?php if ( AuthUser::hasPermission(‘administrator’) || AuthUser::hasPermission(‘developer’) ) { ?>

;-)