5099 Posts in 1519 Topics by 1116 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 437 Views |
-
Help with new admin panel permissions

21 August 2011 at 10:54am Last edited: 30 August 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() {
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
-
Re: Help with new admin panel permissions

30 August 2011 at 1:15am Last edited: 30 August 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:
Behaviour.register({
"#Form_EditForm" : {
getPageFromServer : function(id) {
statusMessage("loading...");
var requestURL = 'admin/events-calendar/show/' + id;
this.loadURLFromServer(requestURL);
$('sitetree').setCurrentByIdx(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?
| 437 Views | ||
|
Page:
1
|
Go to Top |

