CC-4095: Media Library -> Playlist: dj user can delete the playlist owned by

others on some situation.

- fixed
This commit is contained in:
James 2012-07-10 15:11:59 -04:00
parent df5cc8aa38
commit 62b0fec595
1 changed files with 7 additions and 1 deletions

View File

@ -138,7 +138,13 @@ class PlaylistController extends Zend_Controller_Action
try {
if (isset($this->pl_sess->id)) {
$pl = new Application_Model_Playlist($this->pl_sess->id);
$this->view->pl = $pl;
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new Application_Model_User($userInfo->id);
$isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
if($isAdminOrPM || $pl->getCreatorId() == $userInfo->id){
$this->view->pl = $pl;
}
$formatter = new LengthFormatter($pl->getLength());
$this->view->length = $formatter->format();