show delete button when user has deleteOthersNotice right

This commit is contained in:
Evan Prodromou 2009-09-27 21:05:29 -04:00
parent 38345d0783
commit ee236e68df

View File

@ -472,7 +472,10 @@ class NoticeListItem extends Widget
function showDeleteLink() function showDeleteLink()
{ {
$user = common_current_user(); $user = common_current_user();
if ($user && $this->notice->profile_id == $user->id) {
if (!empty($user) &&
($this->notice->profile_id == $user->id || $user->hasRight(Right::deleteOthersNotice))) {
$deleteurl = common_local_url('deletenotice', $deleteurl = common_local_url('deletenotice',
array('notice' => $this->notice->id)); array('notice' => $this->notice->id));
$this->out->element('a', array('href' => $deleteurl, $this->out->element('a', array('href' => $deleteurl,