Beispiel #1
0
 /**
  *	Add password to last opened PS
  *
  *	@param		object		RM_Permission_iPermissionable	Object to add password for
  *	@param		password	string							Password (will be encrypted)
  *	@param		export		int								Expire in seconds. NULL - never
  *	@return		void
  */
 public function pwdAdd(RM_Permission_iPermissionable $object, $password, $expire = NULL)
 {
     $this->_mapper->psAddPassword($this->_psId, $object->_accessId(), $password, $expire);
 }
Beispiel #2
0
 public function entityUpdateAccessInfo(RM_Permission_iPermissionable $object)
 {
     M('Db')->exec("UPDATE " . $this->_fileStorage->table() . " SET access_id = ?, access_inherit = ? WHERE id = ?", $object->_accessId(), $object->_accessInherit(), $object->id());
     $this->_fileStorage->cacheClear($object);
 }
Beispiel #3
0
 /**
  * Updata entity access info 
  *
  * @param RM_Permission_iPermissionable $object
  */
 public function updateAccessInfo(RM_Permission_iPermissionable $object)
 {
     M('Db')->exec("UPDATE " . $this->_tables['holder'] . " SET access_id = ?, access_inherit = ? WHERE id = ?", $object->_accessId(), $object->_accessInherit(), $object->id());
     $this->_storage['holder']->cacheClear($object);
 }
Beispiel #4
0
 /**
  *	Initialize object after creation
  *
  *	@param		object		RM_Permission_iPermissionable
  *	@return		RM_Permission_iPermissionable
  */
 public function initObject(RM_Permission_iPermissionable $object)
 {
     if (!$object->_accessInherit()) {
         $object->_accessId(M('Guid')->get(G('permission_access')));
         $object->_accessInherit(0);
     } else {
         if (isNull($parent = $object->getParent())) {
             throw new RM_Base_Exception_BadUsage("Cannot set 'inherit-flag' for root object: " . get_class($object));
         }
         $object->_accessId($parent->_accessId());
     }
     $object->_updateAccessInfo();
     return $object;
 }