Commit e51e5db5327362dcc23ec1f6e79d04359f206ac9

Authored by nbm
1 parent bcab829e

Return true from hasPermission - permission checks are handled by

dispatchers anyway.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5105 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 1 additions and 50 deletions
lib/session/SiteMap.inc
... ... @@ -140,56 +140,7 @@ class SiteMap {
140 140 * @return boolean true if the user has the access, else false.
141 141 */
142 142 function hasPermission($requiredAccess) {
143   - global $default;
144   -
145   - // if no access control is required
146   - if ($requiredAccess == None) {
147   - return true;
148   - } else {
149   - // if you're a system administrator, you've got access to everything
150   -
151   - // check whether global var intialised
152   - if ($this->isSysAdmin) {
153   - $default->log->debug("-- SiteMap - checking whether a sys admin - GLOBAL VAR SET ");
154   - return true;
155   - } else if ($this->isSysAdmin = Permission::userIsSystemAdministrator()) {
156   - $default->log->debug("-- SiteMap - checking whether a sys admin ...");
157   - return true;
158   - } else {
159   - if ($this->isUnitAdmin || $this->isUnitAdmin = Permission::userIsUnitAdministrator()) {
160   - // if you're a unit administrator, then you have access to everything
161   - // including and less than UA
162   - return ($requiredAccess <= UnitAdmin) ? true : false;
163   - } else if (Permission::userIsGuest()) {
164   - return ($requiredAccess == Guest) ? true : false;
165   - } else {
166   - // you're a "normal" unit user
167   - return ($requiredAccess <= User) ? true : false;
168   - }
169   - }
170   -
171   - // check whether global var intialised
172   - if ($isSysAdmin || $isSysAdmin = Permission::userIsSystemAdministrator()) {
173   - $default->log->debug("-- SiteMap - checking whether a sys admin ...");
174   - return true;
175   - } else {
176   - if ($isUnitAdmin || $isUnitAdmin = Permission::userIsUnitAdministrator()) {
177   - // if you're a unit administrator, then you have access to everything
178   - // including and less than UA
179   - return ($requiredAccess <= UnitAdmin) ? true : false;
180   - } else if (Permission::userIsGuest()) {
181   - return ($requiredAccess == Guest) ? true : false;
182   - } else {
183   - // you're a "normal" unit user
184   - return ($requiredAccess <= User) ? true : false;
185   - }
186   - }
187   - }
188   - // shouldn't ever get here
189   - $default->log->error("SiteMap::hasPermission THERE IS A HOLE IN THE PAGE LEVEL ACCESS SECURITY MODEL!!!");
190   - $default->log->error("SiteMap::hasPermission requiredAccess=$requiredAccess; userID=" . $_SESSION["userID"]);
191   - // return false anyway
192   - return false;
  143 + return true;
193 144 }
194 145  
195 146 /**
... ...