I've customised the eventresources module to use a standard left tree display rather than the default. The Admin class starts:
class EventResourceAdmin extends LeftAndMain {
static $url_segment = 'events-calendar';
static $menu_title = 'Bookings';
static $menu_priority = 0;
static $url_priority = 41;
static $url_rule = '/$Action/$ID/$OtherID';
static $tree_class = "EventResource";
public function init() {
parent::init();
Requirements::javascript('eventresources/javascript/EventResourceAdmin_left.js');
Requirements::javascript('eventresources/javascript/EventResourceAdmin_right.js');
Requirements::css('eventresources/css/EventResource.css');
}
/**
* get_resources retrieves all EventResource objects from the database
*
* @return DataObjectSet
*/
public function get_resources() {
$result = DataObject::get('EventResource');
return $result;
}
/**
* Generate the editform, only if there is a URL ID available
*/
function getEditForm($id = null) {
if(!$id)
$id = $this->urlParams['ID'];
if($id) {
$currentResource = DataObject::get_by_id('EventResource', $id);
$fields = $currentResource->getCMSFields();
// required for form actions
$fields->addFieldToTab('Root.Main', new HiddenField('ID','id #',$id));
$actions = new FieldSet(
new FormAction('doDeleteResource', _t('EventResourceAdmin.DELETERESOURCE','Delete Resource')),
new FormAction('doUpdateResource', _t('EventResourceAdmin.UPDATERESOURCE','Update Resource'))
);
$form = new Form($this, "EditForm", $fields, $actions);
$form->loadDataFrom($currentResource);
return $form;
}
}
Now when I'm logged in as Admin I can access new Admin panel on the top menu, and can access it fine, and add and edit resource records. Yet as soon as I'm logged in as another user in another group, despite the fact there is a record in Permission table with "CMS_ACCESS_EventResourceAdmin" for the correct group, as soon as I access the menu item i just get the Silverstripe logo and 'loading' in top left corner.
I've read bits of the documentation but I really don't get where I'm supposed to be lookingg. Am i dealing with permissions for LeftandMain, DataObjects or what?
Any help appreciated