Hello,
I have created a new page type and its associated data model. Now I want to create a user which should have access to add/edit this particular page type only.
Is this possible in SS? How do I go about it?
Thanks You.
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Hello,
I have created a new page type and its associated data model. Now I want to create a user which should have access to add/edit this particular page type only.
Is this possible in SS? How do I go about it?
Thanks You.
Thank you for the response. I have already gone through that particular page but it left quite confused.
Please see my code below. I added new permission and it shows up fine in the CMS when I try to add a new role. The problem is that if I allow just "Add/edit/delete Jobs" to a new role, that user is unable to access the CMS admin panel.
class Vacancies extends Page {
static $db = array();
static $has_many = array('Jobs' => 'Job');
static $allowed_children = array('none');
static $can_be_root = true;
function getCMSFields() {
$fields = parent::getCMSFields();
$jobsTable = new ComplexTableField($this, 'Jobs', 'Job');
$fields->addFieldToTab("Root.Content.Jobs", $jobsTable);
return $fields;
}
}
class Vacancies_Controller extends Page_Controller {
function init() {
if(!Permission::check("JOB_EDITOR")) Security::permissionFailure();
}
function ActiveJobs() {
return DataObject::get("Job", "ExpiryDate > '".date('Y-m-d')."'");
}
function providePermissions(){
return array(
"JOB_EDITOR" => "Add/edit/delete Jobs"
);
}
}
Did you get anywhere with this?? I want to setup a user to access one page type or a particular page and children when setting up user group it doesn't allow to admin area. I am also confused as to the permissions setup.