Ejemplo n.º 1
0
		/**
		   * Check, whether the given GUID has general Access to this object
		   * @param integer GUID of an accessor that wants to access this object.
		   */
		function hasAccess($guid) {
			// checkOwner...
			if ($this->owner == $guid)
				return true;
			
			// get all the groups the accessor is in.
			$accessor = new Accessor($guid);

			if ($accessor->isSysAdmin())
				return true; // Administrator

			$groups = $accessor->isInGroups();

			// get all the groups, the object is in.
			$myaccessors = array ();
			array_push($myaccessors, $this->owner);
			
			for ($i = 0; $i < count($this->accessors); $i++) {
				array_push($myaccessors, $this->accessors[$i]["ACCESSOR"]);
			}

			if (count(array_intersect($myaccessors, $groups)) > 0) {
				return true;
			} else {
				return false;		
			}
		}