Ticket #499 (closed defect: wontfix)
Admin buttons added via app.yml require admin credentials to see, buttons added via getGlobalButton() method don't
| Reported by: | agilbert | Owned by: | tboutell |
|---|---|---|---|
| Priority: | major | Milestone: | 1.4.1 |
| Component: | apostrophePlugin | Version: | 1.4 |
| Keywords: | Cc: | dordille, johnnyoffline | |
| Symfony version: | 1.4 |
Description
I had a project that needed some custom admin buttons, so I put this in my app.yml:
extra_admin_buttons:
users:
label: Users
action: aUserAdmin/index
class: a-users
reorganize:
label: Reorganize
action: a/reorganize
class: a-reorganize
faculty:
label: Faculty
action: faculty/index
class: a-users
courses:
label: Courses
action: course/index
class: a-courses
This worked as expected when I logged in as a user with the admin credential. But I needed to be able to see the buttons when logged in as an editor.
I was able to make that work by going back to the hard way:
<?php
class frontendConfiguration extends sfApplicationConfiguration
{
public function configure()
{
$this->dispatcher->connect('a.getGlobalButtons', array('frontendConfiguration', 'getGlobalButtons'));
}
static public function getGlobalButtons()
{
aTools::addGlobalButtons(array(
new aGlobalButton('faculty', 'Faculty', 'faculty/index', 'a-users'),
new aGlobalButton('course', 'Courses', 'course/index', 'a-courses')
));
}
}
Apparently buttons added in this way don't care about what the user's credentials are. If the user is logged in and can see the button bar, they will see anything added with the getGlobalButtons() method.
Not sure which of these methods is at fault here, but the fact that it's not consistent says to me that either there is a bug somewhere or something hasn't been appropriately considered.
