Ejemplo n.º 1
0
 /**
  *	Remove usergroup from access list of this report
  *
  *	@return bool
  **/
 public function removeGroupAccess(RM_Account_iGroup $obGroup, RM_List_Object $obList)
 {
     return M('Db')->exec("DELETE FROM " . $this->_tables['access'] . " WHERE list_id = ? AND group_id = ?", $obList->id(), $obGroup->id());
 }
Ejemplo n.º 2
0
 public function checkGroupPermission(RM_Account_iGroup $group, RM_Permission_iPermissionable $object)
 {
     $permData = M('Permission')->getPermission($object);
     $data = $permData->getList();
     return @$data[$group->id()]['READ'] == PERM_ALLOW;
 }
Ejemplo n.º 3
0
 /**
  * Sets a permission for object
  *
  * @param RM_Account_iGroup 	$group			group
  * @param bool 					$grant			TRUE if you ent to set a permission, FLASE for reset
  * @param string 				$permission		Permission type. i.e. READ|WRITE
  */
 public function setPermission(RM_Account_iGroup $group, $grant, $permission)
 {
     M('Permission')->changePermission($this->_root(), array(array($grant ? 'grant' : 'reset', $group->id(), $permission)));
 }
Ejemplo n.º 4
0
 /**
  * @see	RM_List_Mapper::checkGroupAccess
  */
 public function checkGroupAccess(RM_Account_iGroup $obGroup)
 {
     if (!$this->_group_list_access) {
         $this->_group_list_access = $this->_mapper->getGroupsArrayForReport($this);
     }
     return isset($this->_group_list_access[$obGroup->id()]);
 }
Ejemplo n.º 5
0
 /**
  *	Method is deprecated
  *
  *	@return void
  **/
 public function setPermission(RM_Account_iGroup $group, $grant)
 {
     deprecated();
     $permData = M('Permission')->getPermission($this);
     $data = $permData->getList();
     if ($grant) {
         $permData->grant($group->id(), 'READ');
     } else {
         $permData->reset($group->id(), 'READ');
     }
     $permData->save();
 }