I want to have a finer grain control over which users can edit state.
For example, I want one user group to be able to reorder but not publish. So I simply defined two new rules in access.xml:
<action name="core.edit.reorder" title="JACTION_REORDER" description="JACTION_EDITOWN_COMPONENT_DESC" />
<action name="core.edit.publish" title="JACTION_PUBLISH" description="JACTION_EDITOWN_COMPONENT_DESC" />
and then override canEditState in my model like below:
protected function canEditState()
{
$task = JRequest::getVar('task', '', 'POST', 'string' );
$user = JFactory::getUser();
if ($task == 'orderdown' || $task == 'orderup') {
return $user->authorise('core.edit.reorder', $this->option);
} else if ($task == 'publish' || $task == 'unpublish') {
return $user->authorise('core.edit.state', $this->option);
} else {
return false;
}
}
Does that seem reasonable? If so, I am going to have fun creating some more custom rules, me thinks.
A