Location: PHPKode > projects > Fantastic > fantastic-0.0.1_alfa/instalar/ClsIniciarPermisoASTICAdmin.php
<?php
/************************************************************************
Versión del CVS: $Id: ClsIniciarPermisoASTICAdmin.php,v 1.13 2008/02/06 01:46:18 denisjtorresg Exp $

instalar/ClsIniciarPermisoASTICAdmin.php - Copyright denis

Help Desk ASTIC (Administración de Servicios TIC)

**************************************************************************/

global $ASTIC;

$ASTIC->getClaseModulo('publico','PermisoASTICAdmin');

// Constantes de matriz CRUD
define("CRUD_CREATE",0x1);  //0001
define("CRUD_READ",0x2);    //0010
define("CRUD_UPDATE",0x4);  //0100
define("CRUD_DELETE",0x8);  //1000

/**
 * Clase que contiene métodos para inicializar los valores
 * por defecto de grupos, áreas y permisos en las tablas de
 * Live User.
 */
class ClsIniciarPermisoASTICAdmin extends ClsPermisoASTICAdmin {
  var $id_aplicacion = 1;
  var $nombre_aplicacion = 'ASTIC';
  
  /**
   * Constrcutor
   *
   * @return ClsIniciarPermisoASTICAdmin
   */
  function ClsIniciarPermisoASTICAdmin(){
    parent::ClsPermisoASTICAdmin();
  }
  
  function _getNombrePermiso($codigo){
    // Cadenas correspondientes a los permisos en la tabla de derechos de Live User
	$DERECHOS_LIVE_USER = array( 
                      CRUD_CREATE => "Crear", 
                      CRUD_READ => "Ver", 
                      CRUD_UPDATE => "Modificar", 
                      CRUD_DELETE => "Borrar" );
      return $DERECHOS_LIVE_USER[$codigo];
  }
  /**
   * Inicia la instalación si hay error informa del mensaje al manejador de 
   * errores de ASTIC
   * 
   * @return boolean
   */
  function instalar(){
    global $ASTIC;
    
    if(!$this->agregarAplicacionPhpASTIC() ||
       !$this->agregarAreasPhpASTIC() ||
       !$this->agregarDerechosPhpASTIC() ||
       !$this->agregarGruposPhpASTIC() ||
       !$this->grantDerechosGruposPhpASTIC()
    ){
      $ASTIC->agregarMensaje(var_export($this->getErrors(),true),'error');
      return false;
    }
    return true;
  }
  
  /**
   * Agrega la aplicación por defecto a la tabla aplicación de Live User
   *
   * @return boolean
   */
  function agregarAplicacionPhpASTIC(){
    global $ASTIC;

    $datos = array('application_id' => $this->id_aplicacion,
                  'application_define_name' => $this->nombre_aplicacion);
                  
    $id = $this->perm->addApplication($datos);

    return $id;
  }
  
  /**
   * Agrega las áreas por defecto a la tabla de areas de live user
   * 
   * @return boolean
   */
  function agregarAreasPhpASTIC(){
    $areas = $this->getAreasPorDefecto();

    foreach($areas as $area){
    	
      $datos = array('application_id' => $this->id_aplicacion,
                  'area_define_name' => $area);
                  
      $id = $this->perm->addArea($datos);

      if ($id === false)
      		return false;
    }
    return true;
  }
  
  /**
   * Agrega los derechos por defecto de cada área a las tablas de Live User correspondientes 
   *
   * @return boolean
   */
  function agregarDerechosPhpASTIC(){
    $areas = $this->perm->getAreas();
    $derechos = $this->getDerechosPorDefecto();
    
    foreach($areas as $area){
      $area_id = $area["area_id"];
      
      foreach($derechos as $derecho){
        $has_implied = 0;

        $datos = array('area_id' => $area_id,
                  'right_define_name' => $derecho,
                  'has_implied' => $has_implied);
                  
        $id = $this->perm->addRight($datos);
        if ($id === false)
      		return false;
      }
    }
    return true;
  }
  
  /**
   * Agrega a la tabla de grupos de Live User, los usuarios por defecto de ASTIC
   *
   * @return boolean
   */
  function agregarGruposPhpASTIC(){
    $grupos = $this->getGruposPorDefecto();
    
    foreach($grupos as $grupo){
      $datos = array('group_define_name' => $grupo);
      $id = $this->perm->addGroup($datos);
      if ($id === false)
      		return false;
    }
    return true;   
  }
  
  /**
   * Para hacer más facil el arreglo base de permisos por área
   * Este método imprime el arreglo de permisos del admin en base a todas las áreas posibles que 
   * el instalador detecta (revisando la carpeta phpastic/modulos) 
   * 
   */
  function _getArregloDerechosAdmin(){
    $areasPorDefecto = $this->getAreasPorDefecto();

    header("Content-type: text/plain");
    
    print("array(\n");
    foreach($areasPorDefecto as $area){
      printf("\t\"%s\"=>(CRUD_CREATE | CRUD_READ | CRUD_UPDATE | CRUD_DELETE),\n",$area);
    }
    print("\n)");
  }
  
  /**
   * Escribe en la tabla derechos de grupos
   * los permisos por defecto dentro de cada área para cada grupo de usuarios
   * en base a la matris CRUD preestablecida
   * 
   * @return boolean
   */
  function grantDerechosGruposPhpASTIC(){ 
    global $ASTIC;

    $derechos = array();
    
    //ADMIN_CONF 
	$derechos[ADMIN_CONF] = 
	array(
'baseconocimiento'=>(CRUD_READ|0 ),
'ArbolBaseConocimiento'=>(CRUD_READ|0 ),
'ArticuloBaseConocimiento'=>(CRUD_READ|0 ),
'BuscarArticuloBaseConocimiento'=>(CRUD_READ|0 ),
'CategoriaBaseConocimiento'=>(CRUD_READ|0 ),
'ReporteArticuloBaseConocimiento'=>(CRUD_READ|0 ),
'XinhaConfig'=>(CRUD_READ|0 ),
'FAQTecnico'=>(CRUD_READ|0 ),
'cambios'=>(CRUD_READ|0 ),
'HistoricoCPU'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|0 ),
'HistoricoMonitor'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|0 ),
'HistoricoPeriferico'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|0 ),
'HistoricoRaton'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|0 ),
'HistoricoTeclado'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|0 ),
'HistoricoTarjetaRed'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|0 ),
'centrosoporte'=>(CRUD_READ|0 ),
'Incidente'=>(CRUD_CREATE|CRUD_READ|0 ),
'Problema'=>(CRUD_READ|0 ),
'MisIncidentesAbiertos'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'MisIncidentesCerrados'=>(CRUD_READ|0 ),
'MisIncidentesDormidos'=>(CRUD_READ|0 ),
'EstadoIncidenteReportado'=>(CRUD_READ|0 ),
'EstadoIncidenteEsperaCierre'=>(CRUD_READ|0 ),
'HistorialEstadoIncidente'=>(CRUD_READ|0 ),
'InformeIncidentes'=>(CRUD_READ|0 ),
'configuracion'=>(CRUD_READ|0 ),
'estructuraorg'=>(CRUD_READ|0 ),
'UnidadEstructura'=>(CRUD_READ|0 ),
'hardware'=>(CRUD_READ|0 ),
'CPU'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'DispAlmacenamiento'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Idioma'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Interfaz'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Marca'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Monitor'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Periferico'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Procesador'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'RAM'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Raton'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TarjetaInterna'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TarjetaMadre'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TarjetaRed'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Teclado'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TipoDispAlmacenamiento'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TipoMonitor'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TipoPeriferico'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TipoRAM'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TipoRaton'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TipoTarjetaInterna'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'UnidadMedida'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'ReporteHardwareCPU'=>(CRUD_READ|0 ),
'ReporteHardwareMonitor'=>(CRUD_READ|0 ),
'ReporteHardwarePeriferico'=>(CRUD_READ|0 ),
'ReporteHardwareRaton'=>(CRUD_READ|0 ),
'ReporteHardwareTarjetaRed'=>(CRUD_READ|0 ),
'ReporteHardwareDisp_Almacenamiento'=>(CRUD_READ|0 ),
'ReporteHardwareProcesador'=>(CRUD_READ|0 ),
'ReporteHardwareRam'=>(CRUD_READ|0 ),
'ReporteHardwareTarjetaInterna'=>(CRUD_READ|0 ),
'ReporteHardwareTarjetaMadre'=>(CRUD_READ|0 ),
'ReporteHardwareTeclado'=>(CRUD_READ|0 ),
'BuscarHardware'=>(CRUD_READ|0 ),
'TipoDispositivo'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'preferencias'=>(CRUD_READ|0 ),
'PreferenciasUsuario'=>(CRUD_READ|CRUD_UPDATE|0 ),
'CambiarContrasena'=>(CRUD_READ|CRUD_UPDATE|0 ),
'publico'=>(CRUD_READ|0 ),
'AccesoNegado'=>(CRUD_READ|0 ),
'Login'=>(CRUD_READ|0 ),
'CodigoBarras'=>(CRUD_READ|0 ),
'software'=>(CRUD_READ|0 ),
'Licencia'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Plataforma'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Software'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TipoSoftware'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'ReporteSoftware'=>(CRUD_READ|0 ),
'ReporteSoftwareLicencia'=>(CRUD_READ|0 ),
'ayuda'=>(CRUD_READ|0 ),
'Contenido'=>(CRUD_READ|0 ),
'Acerca'=>(CRUD_READ|0 ),
	
	
    );
    
    //ADMIN_BC
	$derechos[ADMIN_BC] = 
	array(
'baseconocimiento'=>(CRUD_READ|0 ),
'ArbolBaseConocimiento'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'ArticuloBaseConocimiento'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'BuscarArticuloBaseConocimiento'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'CategoriaBaseConocimiento'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'ReporteArticuloBaseConocimiento'=>(CRUD_READ|0 ),
'XinhaConfig'=>(CRUD_READ|0 ),
'FAQTecnico'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'cambios'=>(CRUD_READ|0 ),
'HistoricoCPU'=>(CRUD_READ|0 ),
'HistoricoMonitor'=>(CRUD_READ|0 ),
'HistoricoPeriferico'=>(CRUD_READ|0 ),
'HistoricoRaton'=>(CRUD_READ|0 ),
'HistoricoTeclado'=>(CRUD_READ|0 ),
'HistoricoTarjetaRed'=>(CRUD_READ|0 ),
'centrosoporte'=>(CRUD_READ|0 ),
'Incidente'=>(CRUD_CREATE|CRUD_READ|0 ),
'Problema'=>(CRUD_READ|0 ),
'MisIncidentesAbiertos'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'MisIncidentesCerrados'=>(CRUD_READ|0 ),
'MisIncidentesDormidos'=>(CRUD_READ|0 ),
'EstadoIncidenteReportado'=>(CRUD_READ|0 ),
'EstadoIncidenteEsperaCierre'=>(CRUD_READ|0 ),
'HistorialEstadoIncidente'=>(CRUD_READ|0 ),
'InformeIncidentes'=>(CRUD_READ|0 ),
'configuracion'=>(CRUD_READ|0 ),
'estructuraorg'=>(CRUD_READ|0 ),
'UnidadEstructura'=>(CRUD_READ|0 ),
'hardware'=>(CRUD_READ|0 ),
'CPU'=>(CRUD_READ|0 ),
'DispAlmacenamiento'=>(CRUD_READ|0 ),
'Idioma'=>(CRUD_READ|0 ),
'Interfaz'=>(CRUD_READ|0 ),
'Marca'=>(CRUD_READ|0 ),
'Monitor'=>(CRUD_READ|0 ),
'Periferico'=>(CRUD_READ|0 ),
'Procesador'=>(CRUD_READ|0 ),
'RAM'=>(CRUD_READ|0 ),
'Raton'=>(CRUD_READ|0 ),
'TarjetaInterna'=>(CRUD_READ|0 ),
'TarjetaMadre'=>(CRUD_READ|0 ),
'TarjetaRed'=>(CRUD_READ|0 ),
'Teclado'=>(CRUD_READ|0 ),
'TipoDispAlmacenamiento'=>(CRUD_READ|0 ),
'TipoMonitor'=>(CRUD_READ|0 ),
'TipoPeriferico'=>(CRUD_READ|0 ),
'TipoRAM'=>(CRUD_READ|0 ),
'TipoRaton'=>(CRUD_READ|0 ),
'TipoTarjetaInterna'=>(CRUD_READ|0 ),
'UnidadMedida'=>(CRUD_READ|0 ),
'ReporteHardwareCPU'=>(CRUD_READ|0 ),
'ReporteHardwareMonitor'=>(CRUD_READ|0 ),
'ReporteHardwarePeriferico'=>(CRUD_READ|0 ),
'ReporteHardwareRaton'=>(CRUD_READ|0 ),
'ReporteHardwareTarjetaRed'=>(CRUD_READ|0 ),
'ReporteHardwareDisp_Almacenamiento'=>(CRUD_READ|0 ),
'ReporteHardwareProcesador'=>(CRUD_READ|0 ),
'ReporteHardwareRam'=>(CRUD_READ|0 ),
'ReporteHardwareTarjetaInterna'=>(CRUD_READ|0 ),
'ReporteHardwareTarjetaMadre'=>(CRUD_READ|0 ),
'ReporteHardwareTeclado'=>(CRUD_READ|0 ),
'BuscarHardware'=>(CRUD_READ|0 ),
'TipoDispositivo'=>(CRUD_READ|0 ),
'preferencias'=>(CRUD_READ|0 ),
'PreferenciasUsuario'=>(CRUD_READ|CRUD_UPDATE|0 ),
'CambiarContrasena'=>(CRUD_READ|CRUD_UPDATE|0 ),
'publico'=>(CRUD_READ|0 ),
'AccesoNegado'=>(CRUD_READ|0 ),
'Login'=>(CRUD_READ|0 ),
'CodigoBarras'=>(CRUD_READ|0 ),
'software'=>(CRUD_READ|0 ),
'Licencia'=>(CRUD_READ|0 ),
'Plataforma'=>(CRUD_READ|0 ),
'Software'=>(CRUD_READ|0 ),
'TipoSoftware'=>(CRUD_READ|0 ),
'ReporteSoftware'=>(CRUD_READ|0 ),
'ReporteSoftwareLicencia'=>(CRUD_READ|0 ),
'ayuda'=>(CRUD_READ|0 ),
'Contenido'=>(CRUD_READ|0 ),
'Acerca'=>(CRUD_READ|0 ),
	
	
    );
    
    //ADMIN_CS
	$derechos[ADMIN_CS] = 
	array(
'baseconocimiento'=>(CRUD_READ|0 ),
'ArbolBaseConocimiento'=>(CRUD_READ|0 ),
'ArticuloBaseConocimiento'=>(CRUD_READ|0 ),
'BuscarArticuloBaseConocimiento'=>(CRUD_READ|0 ),
'CategoriaBaseConocimiento'=>(CRUD_READ|0 ),
'ReporteArticuloBaseConocimiento'=>(CRUD_READ|0 ),
'XinhaConfig'=>(CRUD_READ|0 ),
'FAQTecnico'=>(CRUD_READ|0 ),
'cambios'=>(CRUD_READ|0 ),
'HistoricoCPU'=>(CRUD_READ|0 ),
'HistoricoMonitor'=>(CRUD_READ|0 ),
'HistoricoPeriferico'=>(CRUD_READ|0 ),
'HistoricoRaton'=>(CRUD_READ|0 ),
'HistoricoTeclado'=>(CRUD_READ|0 ),
'HistoricoTarjetaRed'=>(CRUD_READ|0 ),
'centrosoporte'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Incidente'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Problema'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Servicio'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TipoIncidente'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Prioridad'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'MisIncidentesAbiertos'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'MisIncidentesCerrados'=>(CRUD_READ|0 ),
'BandejaIncidentes'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'MisIncidentesDormidos'=>(CRUD_READ|0 ),
'IncidentesAbiertos'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'IncidentesCerrados'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'IncidentesDormidos'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'EstadoIncidenteReportado'=>(CRUD_READ|0 ),
'EstadoIncidenteActivo'=>(CRUD_READ|0 ),
'EstadoIncidenteEsperaDormir'=>(CRUD_READ|0 ),
'EstadoIncidenteDormido'=>(CRUD_READ|0 ),
'EstadoIncidenteEsperaCierre'=>(CRUD_READ|0 ),
'EstadoIncidenteCerrado'=>(CRUD_READ|0 ),
'HistorialEstadoIncidente'=>(CRUD_CREATE|CRUD_READ|0 ),
'MedioReporte'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'InformeIncidentes'=>(CRUD_READ|0 ),
'configuracion'=>(CRUD_READ|0 ),
'estructuraorg'=>(CRUD_READ|0 ),
'UnidadEstructura'=>(CRUD_READ|0 ),
'hardware'=>(CRUD_READ|0 ),
'CPU'=>(CRUD_READ|0 ),
'DispAlmacenamiento'=>(CRUD_READ|0 ),
'Idioma'=>(CRUD_READ|0 ),
'Interfaz'=>(CRUD_READ|0 ),
'Marca'=>(CRUD_READ|0 ),
'Monitor'=>(CRUD_READ|0 ),
'Periferico'=>(CRUD_READ|0 ),
'Procesador'=>(CRUD_READ|0 ),
'RAM'=>(CRUD_READ|0 ),
'Raton'=>(CRUD_READ|0 ),
'TarjetaInterna'=>(CRUD_READ|0 ),
'TarjetaMadre'=>(CRUD_READ|0 ),
'TarjetaRed'=>(CRUD_READ|0 ),
'Teclado'=>(CRUD_READ|0 ),
'TipoDispAlmacenamiento'=>(CRUD_READ|0 ),
'TipoMonitor'=>(CRUD_READ|0 ),
'TipoPeriferico'=>(CRUD_READ|0 ),
'TipoRAM'=>(CRUD_READ|0 ),
'TipoRaton'=>(CRUD_READ|0 ),
'TipoTarjetaInterna'=>(CRUD_READ|0 ),
'UnidadMedida'=>(CRUD_READ|0 ),
'ReporteHardwareCPU'=>(CRUD_READ|0 ),
'ReporteHardwareMonitor'=>(CRUD_READ|0 ),
'ReporteHardwarePeriferico'=>(CRUD_READ|0 ),
'ReporteHardwareRaton'=>(CRUD_READ|0 ),
'ReporteHardwareTarjetaRed'=>(CRUD_READ|0 ),
'ReporteHardwareDisp_Almacenamiento'=>(CRUD_READ|0 ),
'ReporteHardwareProcesador'=>(CRUD_READ|0 ),
'ReporteHardwareRam'=>(CRUD_READ|0 ),
'ReporteHardwareTarjetaInterna'=>(CRUD_READ|0 ),
'ReporteHardwareTarjetaMadre'=>(CRUD_READ|0 ),
'ReporteHardwareTeclado'=>(CRUD_READ|0 ),
'BuscarHardware'=>(CRUD_READ|0 ),
'TipoDispositivo'=>(CRUD_READ|0 ),
'preferencias'=>(CRUD_READ|0 ),
'PreferenciasUsuario'=>(CRUD_READ|CRUD_UPDATE|0 ),
'CambiarContrasena'=>(CRUD_READ|CRUD_UPDATE|0 ),
'publico'=>(CRUD_READ|0 ),
'AccesoNegado'=>(CRUD_READ|0 ),
'Login'=>(CRUD_READ|0 ),
'CodigoBarras'=>(CRUD_READ|0 ),
'software'=>(CRUD_READ|0 ),
'Licencia'=>(CRUD_READ|0 ),
'Plataforma'=>(CRUD_READ|0 ),
'Software'=>(CRUD_READ|0 ),
'TipoSoftware'=>(CRUD_READ|0 ),
'ReporteSoftware'=>(CRUD_READ|0 ),
'ReporteSoftwareLicencia'=>(CRUD_READ|0 ),
'ayuda'=>(CRUD_READ|0 ),
'Contenido'=>(CRUD_READ|0 ),
'Acerca'=>(CRUD_READ|0 ),
	
	
    );
	
    //ADMIN_CAMB
	$derechos[ADMIN_CAMB] = 
	array(
'baseconocimiento'=>(CRUD_READ|0 ),
'ArbolBaseConocimiento'=>(CRUD_READ|0 ),
'ArticuloBaseConocimiento'=>(CRUD_READ|0 ),
'BuscarArticuloBaseConocimiento'=>(CRUD_READ|0 ),
'CategoriaBaseConocimiento'=>(CRUD_READ|0 ),
'ReporteArticuloBaseConocimiento'=>(CRUD_READ|0 ),
'XinhaConfig'=>(CRUD_READ|0 ),
'FAQTecnico'=>(CRUD_READ|0 ),
'cambios'=>(CRUD_READ|0 ),
'HistoricoCPU'=>(CRUD_READ|0 ),
'HistoricoMonitor'=>(CRUD_READ|0 ),
'HistoricoPeriferico'=>(CRUD_READ|0 ),
'HistoricoRaton'=>(CRUD_READ|0 ),
'HistoricoTeclado'=>(CRUD_READ|0 ),
'HistoricoTarjetaRed'=>(CRUD_READ|0 ),
'centrosoporte'=>(CRUD_READ|0 ),
'Incidente'=>(CRUD_CREATE|CRUD_READ|0 ),
'Problema'=>(CRUD_READ|0 ),
'MisIncidentesAbiertos'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'MisIncidentesCerrados'=>(CRUD_READ|0 ),
'MisIncidentesDormidos'=>(CRUD_READ|0 ),
'EstadoIncidenteReportado'=>(CRUD_READ|0 ),
'EstadoIncidenteEsperaCierre'=>(CRUD_READ|0 ),
'HistorialEstadoIncidente'=>(CRUD_READ|0 ),
'InformeIncidentes'=>(CRUD_READ|0 ),
'configuracion'=>(CRUD_READ|0 ),
'estructuraorg'=>(CRUD_READ|0 ),
'UnidadEstructura'=>(CRUD_READ|0 ),
'hardware'=>(CRUD_READ|0 ),
'CPU'=>(CRUD_READ|0 ),
'DispAlmacenamiento'=>(CRUD_READ|0 ),
'Idioma'=>(CRUD_READ|0 ),
'Interfaz'=>(CRUD_READ|0 ),
'Marca'=>(CRUD_READ|0 ),
'Monitor'=>(CRUD_READ|0 ),
'Periferico'=>(CRUD_READ|0 ),
'Procesador'=>(CRUD_READ|0 ),
'RAM'=>(CRUD_READ|0 ),
'Raton'=>(CRUD_READ|0 ),
'TarjetaInterna'=>(CRUD_READ|0 ),
'TarjetaMadre'=>(CRUD_READ|0 ),
'TarjetaRed'=>(CRUD_READ|0 ),
'Teclado'=>(CRUD_READ|0 ),
'TipoDispAlmacenamiento'=>(CRUD_READ|0 ),
'TipoMonitor'=>(CRUD_READ|0 ),
'TipoPeriferico'=>(CRUD_READ|0 ),
'TipoRAM'=>(CRUD_READ|0 ),
'TipoRaton'=>(CRUD_READ|0 ),
'TipoTarjetaInterna'=>(CRUD_READ|0 ),
'UnidadMedida'=>(CRUD_READ|0 ),
'ReporteHardwareCPU'=>(CRUD_READ|0 ),
'ReporteHardwareMonitor'=>(CRUD_READ|0 ),
'ReporteHardwarePeriferico'=>(CRUD_READ|0 ),
'ReporteHardwareRaton'=>(CRUD_READ|0 ),
'ReporteHardwareTarjetaRed'=>(CRUD_READ|0 ),
'ReporteHardwareDisp_Almacenamiento'=>(CRUD_READ|0 ),
'ReporteHardwareProcesador'=>(CRUD_READ|0 ),
'ReporteHardwareRam'=>(CRUD_READ|0 ),
'ReporteHardwareTarjetaInterna'=>(CRUD_READ|0 ),
'ReporteHardwareTarjetaMadre'=>(CRUD_READ|0 ),
'ReporteHardwareTeclado'=>(CRUD_READ|0 ),
'BuscarHardware'=>(CRUD_READ|0 ),
'TipoDispositivo'=>(CRUD_READ|0 ),
'preferencias'=>(CRUD_READ|0 ),
'PreferenciasUsuario'=>(CRUD_READ|CRUD_UPDATE|0 ),
'CambiarContrasena'=>(CRUD_READ|CRUD_UPDATE|0 ),
'publico'=>(CRUD_READ|0 ),
'AccesoNegado'=>(CRUD_READ|0 ),
'Login'=>(CRUD_READ|0 ),
'CodigoBarras'=>(CRUD_READ|0 ),
'software'=>(CRUD_READ|0 ),
'Licencia'=>(CRUD_READ|0 ),
'Plataforma'=>(CRUD_READ|0 ),
'Software'=>(CRUD_READ|0 ),
'TipoSoftware'=>(CRUD_READ|0 ),
'ReporteSoftware'=>(CRUD_READ|0 ),
'ReporteSoftwareLicencia'=>(CRUD_READ|0 ),
'ayuda'=>(CRUD_READ|0 ),
'Contenido'=>(CRUD_READ|0 ),
'Acerca'=>(CRUD_READ|0 ),
	
	
    );
    
    //ADMIN_USR	
	$derechos[ADMIN_USR] = 
	array(
'baseconocimiento'=>(CRUD_READ|0 ),
'ArbolBaseConocimiento'=>(CRUD_READ|0 ),
'ArticuloBaseConocimiento'=>(CRUD_READ|0 ),
'BuscarArticuloBaseConocimiento'=>(CRUD_READ|0 ),
'CategoriaBaseConocimiento'=>(CRUD_READ|0 ),
'ReporteArticuloBaseConocimiento'=>(CRUD_READ|0 ),
'XinhaConfig'=>(CRUD_READ|0 ),
'FAQTecnico'=>(CRUD_READ|0 ),
'centrosoporte'=>(CRUD_READ|0 ),
'Incidente'=>(CRUD_CREATE|CRUD_READ|0 ),
'MisIncidentesAbiertos'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'MisIncidentesCerrados'=>(CRUD_READ|0 ),
'MisIncidentesDormidos'=>(CRUD_READ|0 ),
'EstadoIncidenteReportado'=>(CRUD_READ|0 ),
'EstadoIncidenteEsperaCierre'=>(CRUD_READ|0 ),
'HistorialEstadoIncidente'=>(CRUD_READ|0 ),
'preferencias'=>(CRUD_READ|0 ),
'PreferenciasUsuario'=>(CRUD_READ|CRUD_UPDATE|0 ),
'CambiarContrasena'=>(CRUD_READ|CRUD_UPDATE|0 ),
'publico'=>(CRUD_READ|0 ),
'AccesoNegado'=>(CRUD_READ|0 ),
'Login'=>(CRUD_READ|0 ),
'usuarios'=>(CRUD_READ|0 ),
'Grupo'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Usuario'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'ayuda'=>(CRUD_READ|0 ),
'Contenido'=>(CRUD_READ|0 ),
'Acerca'=>(CRUD_READ|0 ),
	
	);
    
    //ADMIN_EO
	$derechos[ADMIN_EO] = 
	array(
'baseconocimiento'=>(CRUD_READ|0 ),
'ArbolBaseConocimiento'=>(CRUD_READ|0 ),
'ArticuloBaseConocimiento'=>(CRUD_READ|0 ),
'BuscarArticuloBaseConocimiento'=>(CRUD_READ|0 ),
'CategoriaBaseConocimiento'=>(CRUD_READ|0 ),
'ReporteArticuloBaseConocimiento'=>(CRUD_READ|0 ),
'XinhaConfig'=>(CRUD_READ|0 ),
'FAQTecnico'=>(CRUD_READ|0 ),
'cambios'=>(CRUD_READ|0 ),
'HistoricoCPU'=>(CRUD_READ|0 ),
'HistoricoMonitor'=>(CRUD_READ|0 ),
'HistoricoPeriferico'=>(CRUD_READ|0 ),
'HistoricoRaton'=>(CRUD_READ|0 ),
'HistoricoTeclado'=>(CRUD_READ|0 ),
'HistoricoTarjetaRed'=>(CRUD_READ|0 ),
'centrosoporte'=>(CRUD_READ|0 ),
'Incidente'=>(CRUD_CREATE|CRUD_READ|0 ),
'Problema'=>(CRUD_READ|0 ),
'MisIncidentesAbiertos'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'MisIncidentesCerrados'=>(CRUD_READ|0 ),
'MisIncidentesDormidos'=>(CRUD_READ|0 ),
'EstadoIncidenteReportado'=>(CRUD_READ|0 ),
'EstadoIncidenteEsperaCierre'=>(CRUD_READ|0 ),
'HistorialEstadoIncidente'=>(CRUD_READ|0 ),
'configuracion'=>(CRUD_READ|0 ),
'estructuraorg'=>(CRUD_READ|0 ),
'UnidadEstructura'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'hardware'=>(CRUD_READ|0 ),
'CPU'=>(CRUD_READ|0 ),
'DispAlmacenamiento'=>(CRUD_READ|0 ),
'Idioma'=>(CRUD_READ|0 ),
'Interfaz'=>(CRUD_READ|0 ),
'Marca'=>(CRUD_READ|0 ),
'Monitor'=>(CRUD_READ|0 ),
'Periferico'=>(CRUD_READ|0 ),
'Procesador'=>(CRUD_READ|0 ),
'RAM'=>(CRUD_READ|0 ),
'Raton'=>(CRUD_READ|0 ),
'TarjetaInterna'=>(CRUD_READ|0 ),
'TarjetaMadre'=>(CRUD_READ|0 ),
'TarjetaRed'=>(CRUD_READ|0 ),
'Teclado'=>(CRUD_READ|0 ),
'TipoDispAlmacenamiento'=>(CRUD_READ|0 ),
'TipoMonitor'=>(CRUD_READ|0 ),
'TipoPeriferico'=>(CRUD_READ|0 ),
'TipoRAM'=>(CRUD_READ|0 ),
'TipoRaton'=>(CRUD_READ|0 ),
'TipoTarjetaInterna'=>(CRUD_READ|0 ),
'UnidadMedida'=>(CRUD_READ|0 ),
'ReporteHardwareCPU'=>(CRUD_READ|0 ),
'ReporteHardwareMonitor'=>(CRUD_READ|0 ),
'ReporteHardwarePeriferico'=>(CRUD_READ|0 ),
'ReporteHardwareRaton'=>(CRUD_READ|0 ),
'ReporteHardwareTarjetaRed'=>(CRUD_READ|0 ),
'ReporteHardwareDisp_Almacenamiento'=>(CRUD_READ|0 ),
'ReporteHardwareProcesador'=>(CRUD_READ|0 ),
'ReporteHardwareRam'=>(CRUD_READ|0 ),
'ReporteHardwareTarjetaInterna'=>(CRUD_READ|0 ),
'ReporteHardwareTarjetaMadre'=>(CRUD_READ|0 ),
'ReporteHardwareTeclado'=>(CRUD_READ|0 ),
'BuscarHardware'=>(CRUD_READ|0 ),
'TipoDispositivo'=>(CRUD_READ|0 ),
'preferencias'=>(CRUD_READ|0 ),
'PreferenciasUsuario'=>(CRUD_READ|CRUD_UPDATE|0 ),
'CambiarContrasena'=>(CRUD_READ|CRUD_UPDATE|0 ),
'publico'=>(CRUD_READ|0 ),
'AccesoNegado'=>(CRUD_READ|0 ),
'Login'=>(CRUD_READ|0 ),
'CodigoBarras'=>(CRUD_READ|0 ),
'ayuda'=>(CRUD_READ|0 ),
'Contenido'=>(CRUD_READ|0 ),
'Acerca'=>(CRUD_READ|0 ),
	
	
    );
    
    //SUPER_ADMIN
	$derechos[SUPER_ADMIN] = 
	array(
'admin'=>(CRUD_READ|0 ),
'Configuracion'=>(CRUD_READ|CRUD_UPDATE|0 ),
'baseconocimiento'=>(CRUD_READ|0 ),
'ArbolBaseConocimiento'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'ArticuloBaseConocimiento'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'BuscarArticuloBaseConocimiento'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'CategoriaBaseConocimiento'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'ReporteArticuloBaseConocimiento'=>(CRUD_READ|0 ),
'XinhaConfig'=>(CRUD_READ|0 ),
'FAQTecnico'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'cambios'=>(CRUD_READ|0 ),
'HistoricoCPU'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|0 ),
'HistoricoMonitor'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|0 ),
'HistoricoPeriferico'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|0 ),
'HistoricoRaton'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|0 ),
'HistoricoTeclado'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|0 ),
'HistoricoTarjetaRed'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|0 ),
'centrosoporte'=>(CRUD_READ|0 ),
'Incidente'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Problema'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Servicio'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TipoIncidente'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Prioridad'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'MisIncidentesAbiertos'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'MisIncidentesCerrados'=>(CRUD_READ|0 ),
'BandejaIncidentes'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'MisIncidentesDormidos'=>(CRUD_READ|0 ),
'IncidentesAbiertos'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'IncidentesCerrados'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'IncidentesDormidos'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'EstadoIncidenteReportado'=>(CRUD_READ|0 ),
'EstadoIncidenteActivo'=>(CRUD_READ|0 ),
'EstadoIncidenteEsperaDormir'=>(CRUD_READ|0 ),
'EstadoIncidenteDormido'=>(CRUD_READ|0 ),
'EstadoIncidenteEsperaCierre'=>(CRUD_READ|0 ),
'EstadoIncidenteCerrado'=>(CRUD_READ|0 ),
'HistorialEstadoIncidente'=>(CRUD_CREATE|CRUD_READ|0 ),
'MedioReporte'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'InformeIncidentes'=>(CRUD_READ|0 ),
'configuracion'=>(CRUD_READ|0 ),
'estructuraorg'=>(CRUD_READ|0 ),
'UnidadEstructura'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'hardware'=>(CRUD_READ|0 ),
'CPU'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'DispAlmacenamiento'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Idioma'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Interfaz'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Marca'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Monitor'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Periferico'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Procesador'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'RAM'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Raton'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TarjetaInterna'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TarjetaMadre'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TarjetaRed'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Teclado'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TipoDispAlmacenamiento'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TipoMonitor'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TipoPeriferico'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TipoRAM'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TipoRaton'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TipoTarjetaInterna'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'UnidadMedida'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'ReporteHardwareCPU'=>(CRUD_READ|0 ),
'ReporteHardwareMonitor'=>(CRUD_READ|0 ),
'ReporteHardwarePeriferico'=>(CRUD_READ|0 ),
'ReporteHardwareRaton'=>(CRUD_READ|0 ),
'ReporteHardwareTarjetaRed'=>(CRUD_READ|0 ),
'ReporteHardwareDisp_Almacenamiento'=>(CRUD_READ|0 ),
'ReporteHardwareProcesador'=>(CRUD_READ|0 ),
'ReporteHardwareRam'=>(CRUD_READ|0 ),
'ReporteHardwareTarjetaInterna'=>(CRUD_READ|0 ),
'ReporteHardwareTarjetaMadre'=>(CRUD_READ|0 ),
'ReporteHardwareTeclado'=>(CRUD_READ|0 ),
'BuscarHardware'=>(CRUD_READ|0 ),
'TipoDispositivo'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'preferencias'=>(CRUD_READ|0 ),
'PreferenciasUsuario'=>(CRUD_READ|CRUD_UPDATE|0 ),
'CambiarContrasena'=>(CRUD_READ|CRUD_UPDATE|0 ),
'Preferencias'=>(CRUD_READ|CRUD_UPDATE|0 ),
'publico'=>(CRUD_READ|0 ),
'AccesoNegado'=>(CRUD_READ|0 ),
'Login'=>(CRUD_READ|0 ),
'CodigoBarras'=>(CRUD_READ|0 ),
'software'=>(CRUD_READ|0 ),
'Licencia'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Plataforma'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Software'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'TipoSoftware'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'ReporteSoftware'=>(CRUD_READ|0 ),
'ReporteSoftwareLicencia'=>(CRUD_READ|0 ),
'usuarios'=>(CRUD_READ|0 ),
'Grupo'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'Usuario'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'ayuda'=>(CRUD_READ|0 ),
'Contenido'=>(CRUD_READ|0 ),
'Acerca'=>(CRUD_READ|0 ),

    );
    
    //USR_TIC
	$derechos[USR_TIC] = 
	array(
'baseconocimiento'=>(CRUD_READ|0 ),
'ArbolBaseConocimiento'=>(CRUD_READ|0 ),
'ArticuloBaseConocimiento'=>(CRUD_READ|0 ),
'BuscarArticuloBaseConocimiento'=>(CRUD_READ|0 ),
'CategoriaBaseConocimiento'=>(CRUD_READ|0 ),
'ReporteArticuloBaseConocimiento'=>(CRUD_READ|0 ),
'XinhaConfig'=>(CRUD_READ|0 ),
'centrosoporte'=>(CRUD_READ|0 ),
'Incidente'=>(CRUD_CREATE|CRUD_READ|0 ),
'MisIncidentesAbiertos'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'MisIncidentesCerrados'=>(CRUD_READ|0 ),
'MisIncidentesDormidos'=>(CRUD_READ|0 ),
'EstadoIncidenteReportado'=>(CRUD_READ|0 ),
'EstadoIncidenteEsperaCierre'=>(CRUD_READ|0 ),
'preferencias'=>(CRUD_READ|0 ),
'PreferenciasUsuario'=>(CRUD_READ|CRUD_UPDATE|0 ),
'publico'=>(CRUD_READ|0 ),
'AccesoNegado'=>(CRUD_READ|0 ),
'Login'=>(CRUD_READ|0 ),
'ayuda'=>(CRUD_READ|0 ),
'Contenido'=>(CRUD_READ|0 ),
'Acerca'=>(CRUD_READ|0 ),
	
	
    );

    //TECNICO
	$derechos[TECNICO] = 
	array(
'baseconocimiento'=>(CRUD_READ|0 ),
'ArbolBaseConocimiento'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'ArticuloBaseConocimiento'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'BuscarArticuloBaseConocimiento'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'CategoriaBaseConocimiento'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'ReporteArticuloBaseConocimiento'=>(CRUD_READ|0 ),
'XinhaConfig'=>(CRUD_READ|0 ),
'FAQTecnico'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'cambios'=>(CRUD_READ|0 ),
'HistoricoCPU'=>(CRUD_READ|0 ),
'HistoricoMonitor'=>(CRUD_READ|0 ),
'HistoricoPeriferico'=>(CRUD_READ|0 ),
'HistoricoRaton'=>(CRUD_READ|0 ),
'HistoricoTeclado'=>(CRUD_READ|0 ),
'HistoricoTarjetaRed'=>(CRUD_READ|0 ),
'centrosoporte'=>(CRUD_READ|0 ),
'Incidente'=>(CRUD_CREATE|CRUD_READ|0 ),
'MisIncidentesAbiertos'=>(CRUD_CREATE|CRUD_READ|CRUD_UPDATE|CRUD_DELETE|0 ),
'MisIncidentesCerrados'=>(CRUD_READ|0 ),
'MisIncidentesAsignados'=>(CRUD_READ|CRUD_UPDATE|0 ),
'MisIncidentesTerminados'=>(CRUD_READ|0 ),
'MisIncidentesDormidos'=>(CRUD_READ|0 ),
'MisIncidentesAsignadosDormidos'=>(CRUD_READ|0 ),
'EstadoIncidenteReportado'=>(CRUD_READ|0 ),
'EstadoIncidenteEsperaDormir'=>(CRUD_READ|0 ),
'EstadoIncidenteEsperaCierre'=>(CRUD_READ|0 ),
'HistorialEstadoIncidente'=>(CRUD_CREATE|CRUD_READ|0 ),
'InformeIncidentes'=>(CRUD_READ|0 ),
'configuracion'=>(CRUD_READ|0 ),
'estructuraorg'=>(CRUD_READ|0 ),
'UnidadEstructura'=>(CRUD_READ|0 ),
'hardware'=>(CRUD_READ|0 ),
'CPU'=>(CRUD_READ|0 ),
'DispAlmacenamiento'=>(CRUD_READ|0 ),
'Idioma'=>(CRUD_READ|0 ),
'Interfaz'=>(CRUD_READ|0 ),
'Marca'=>(CRUD_READ|0 ),
'Monitor'=>(CRUD_READ|0 ),
'Periferico'=>(CRUD_READ|0 ),
'Procesador'=>(CRUD_READ|0 ),
'RAM'=>(CRUD_READ|0 ),
'Raton'=>(CRUD_READ|0 ),
'TarjetaInterna'=>(CRUD_READ|0 ),
'TarjetaMadre'=>(CRUD_READ|0 ),
'TarjetaRed'=>(CRUD_READ|0 ),
'Teclado'=>(CRUD_READ|0 ),
'TipoDispAlmacenamiento'=>(CRUD_READ|0 ),
'TipoMonitor'=>(CRUD_READ|0 ),
'TipoPeriferico'=>(CRUD_READ|0 ),
'TipoRAM'=>(CRUD_READ|0 ),
'TipoRaton'=>(CRUD_READ|0 ),
'TipoTarjetaInterna'=>(CRUD_READ|0 ),
'UnidadMedida'=>(CRUD_READ|0 ),
'ReporteHardwareCPU'=>(CRUD_READ|0 ),
'ReporteHardwareMonitor'=>(CRUD_READ|0 ),
'ReporteHardwarePeriferico'=>(CRUD_READ|0 ),
'ReporteHardwareRaton'=>(CRUD_READ|0 ),
'ReporteHardwareTarjetaRed'=>(CRUD_READ|0 ),
'ReporteHardwareDisp_Almacenamiento'=>(CRUD_READ|0 ),
'ReporteHardwareProcesador'=>(CRUD_READ|0 ),
'ReporteHardwareRam'=>(CRUD_READ|0 ),
'ReporteHardwareTarjetaInterna'=>(CRUD_READ|0 ),
'ReporteHardwareTarjetaMadre'=>(CRUD_READ|0 ),
'ReporteHardwareTeclado'=>(CRUD_READ|0 ),
'BuscarHardware'=>(CRUD_READ|0 ),
'TipoDispositivo'=>(CRUD_READ|0 ),
'preferencias'=>(CRUD_READ|0 ),
'PreferenciasUsuario'=>(CRUD_READ|CRUD_UPDATE|0 ),
'CambiarContrasena'=>(CRUD_READ|CRUD_UPDATE|0 ),
'publico'=>(CRUD_READ|0 ),
'AccesoNegado'=>(CRUD_READ|0 ),
'Login'=>(CRUD_READ|0 ),
'CodigoBarras'=>(CRUD_READ|0 ),
'software'=>(CRUD_READ|0 ),
'Licencia'=>(CRUD_READ|0 ),
'Plataforma'=>(CRUD_READ|0 ),
'Software'=>(CRUD_READ|0 ),
'TipoSoftware'=>(CRUD_READ|0 ),
'ReporteSoftware'=>(CRUD_READ|0 ),
'ReporteSoftwareLicencia'=>(CRUD_READ|0 ),
'ayuda'=>(CRUD_READ|0 ),
'Contenido'=>(CRUD_READ|0 ),
'Acerca'=>(CRUD_READ|0 ),
	
	);
    
    foreach($derechos as $nombreGrupo => $derecho){  
      $filtro_grupo = array('filters'=>array("group_define_name"=>$nombreGrupo));
      $detalleGroupo = $this->perm->getGroups($filtro_grupo);
      
      if(empty($detalleGroupo)){
        $ASTIC->agregarMensaje("grantDerechosGruposPhpASTIC dice: Grupo {$nombreGrupo} no encontrado. No preocuparse.",'warning'); 
        continue;
      }
        
      foreach($derecho as $area=>$permiso){
        $filtro_area = array('filters'=>array("area_define_name"=>$area));
        $detalleArea = $this->perm->getAreas($filtro_area);
        
        if(empty($detalleArea)){
          $ASTIC->agregarMensaje("grantDerechosGruposPhpASTIC dice: Area {$area} no encontrada. No preocuparse.",'warning'); 
          continue;
        }
        
        if($permiso & CRUD_CREATE){
          $filtro_derecho = array('filters'=>array("area_id"=>$detalleArea[0]['area_id'],"right_define_name"=>$this->_getNombrePermiso(CRUD_CREATE)));
          $detalleDerecho = $this->perm->getRights($filtro_derecho);

          if(!$this->_otorgarDerechoGrupo($detalleDerecho[0]['right_id'],$detalleGroupo[0]['group_id'])) return false;
        }
        
        if($permiso & CRUD_READ){
          $filtro_derecho = array('filters'=>array("area_id"=>$detalleArea[0]['area_id'],"right_define_name"=>$this->_getNombrePermiso(CRUD_READ)));
          $detalleDerecho = $this->perm->getRights($filtro_derecho);
          
          if(!$this->_otorgarDerechoGrupo($detalleDerecho[0]['right_id'],$detalleGroupo[0]['group_id'])) return false;
        }
        
        if($permiso & CRUD_UPDATE){
          $filtro_derecho = array('filters'=>array("area_id"=>$detalleArea[0]['area_id'],"right_define_name"=>$this->_getNombrePermiso(CRUD_UPDATE)));
          $detalleDerecho = $this->perm->getRights($filtro_derecho);          

          if(!$this->_otorgarDerechoGrupo($detalleDerecho[0]['right_id'],$detalleGroupo[0]['group_id'])) return false;
        }
        
        if($permiso & CRUD_DELETE){
          $filtro_derecho = array('filters'=>array("area_id"=>$detalleArea[0]['area_id'],"right_define_name"=>$this->_getNombrePermiso(CRUD_DELETE)));
          $detalleDerecho = $this->perm->getRights($filtro_derecho);
          
          if(!$this->_otorgarDerechoGrupo($detalleDerecho[0]['right_id'],$detalleGroupo[0]['group_id'])) return false;
        }
        
      }
    }
	return true;
  }
  
  /**
   * Método que ayuda a grantDerechosGruposPhpASTIC
   * para asiganr los permisos a cada grupo
   *
   * @param identificador del permiso a otorgar $right_id
   * @param identificador del grupo sobre el que se entrega el permiso $group_id
   * @return boolean
   */
  function _otorgarDerechoGrupo($right_id,$group_id){
    if(empty($right_id) || empty($group_id)) return false;
     
    $datos = array('right_id' => $right_id,
                  'group_id' => $group_id
                 );   
     return $this->perm->grantGroupRight($datos); 
  }
}
?>
Return current item: Fantastic