diff --git a/include/application.php b/include/application.php index 0c053b7..b5f3c4a 100644 --- a/include/application.php +++ b/include/application.php @@ -903,6 +903,8 @@ class Application { { if($_SESSION['current']->hasPriv("admin")) return TRUE; + else if($this) + return maintainer::isUserSuperMaintainer($_SESSION['current'], $this->iAppId); else return FALSE; } diff --git a/include/url.php b/include/url.php index 7f87ea2..2607447 100644 --- a/include/url.php +++ b/include/url.php @@ -453,17 +453,18 @@ class Url { function canEdit($iVersionId, $iAppId = NULL) { - $oUser = new User($_SESSION['current']->iUserId); - - if($oUser->hasPriv("admin") || ($iVersionId && - maintainer::isUserMaintainer($oUser, $iVersionId)) || ($iAppId && - maintainer::isSuperMaintainer($oUser, $iAppId))) - { + if($_SESSION['current']->hasPriv("admin")) return TRUE; - } else + else if($iVersionId) { + $oVersion = new version($iVersionId); + return $oVersion->canEdit(); + } else if($iAppId) + { + $oApp = new application($iAppId); + return $oApp->canEdit(); + } else return FALSE; - } } /* Display links for a given version/application */