Is there scope for updating the Entries fieldtype so that only sections editable by the user are shown in the pop-up modal?

Obviously don't want to go changing the core files, but some digging suggests that a simple change to the getSources method in /craft/app/elementtypes/EntryElementType.php should do the trick, eg:

foreach ($sectionsByType[$type] as $section) {
    $key = 'section:'.$section->id;
    $valid = craft()->userSession->checkPermission('publishEntries:'.$section->id);
    if ($valid == 1) {
        $sources[$key] = array(
            'label'    => Craft::t($section->name),
            'data'     => array('type' => $type, 'handle' => $section->handle),
            'criteria' => array('sectionId' => $section->id, 'editable' => $editable)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.