Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Help with new admin panel permissions

Go to End

3 Posts   1257 Views


Community Member, 117 Posts

21 August 2011 at 10:54am

Edited: 30/08/2011 1:31am

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() {

	 * 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) {
			$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);

			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


Community Member, 117 Posts

22 August 2011 at 10:39pm



Community Member, 117 Posts

30 August 2011 at 1:15am

Edited: 30/08/2011 1:42am

Got one step further with this, it now diplays tree on left hand side, but when selecting item in left tree the right side form displays:

Fatal error: Call to undefined method SS_HTTPResponse::formHtmlContent() in /home/reddemo/public_html/fulbourn/cms/code/LeftAndMain.php on line 372

As i said, this only when happens when logged in as user. When logged in as Admin it displays fine.

My EventResourceAdmin_left.js is:

	"#Form_EditForm" : {
		getPageFromServer : function(id) {
			var requestURL = 'admin/events-calendar/show/' + id;

Which may be where the problems lies, but I don't see why it should work logged in as Admin and not as a user with lesser permissions. The user does not have permission to 'Edit any page' could that be issue?