コード例 #1
0
ファイル: permissions.php プロジェクト: VonUniGE/concrete5-1
 /**
  *
  * The constructor for the permissions object, a Collection, Version, Area or Block object is passed
  * and a special sub-object is returned, which can then be checked against to see the if the user can 
  * view it, edit it, etc...
  * @param mixed $unknownObj
  *
  */
 function Permissions(&$unknownObj)
 {
     // The permissions object is given another, and it basically checks to see if the logged-in
     // user has given permissions for that object, whatever it may be
     $this->u = new User();
     $this->originalObj = $unknownObj;
     /*	
     		if ($unknownObj->getError()) {
     			// inherit the error from the object
     			$this->permError = $unknownObj->getError();
     		}*/
     if (PermissionsCache::exists($unknownObj)) {
         $po = PermissionsCache::getObject($unknownObj);
         $this->loadPermissionSet($po);
         return;
     }
     $po = PermissionsProxy::get($unknownObj);
     $this->loadPermissionSet($po);
     PermissionsCache::add($unknownObj, $po);
 }