salix/db/routines/vn/functions/deviceProductionUser_access...

30 lines
739 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`deviceProductionUser_accessGranted`(vUserFK INT(10) , android_id VARCHAR(50))
RETURNS tinyint(1)
DETERMINISTIC
BEGIN
/*
* Comprueba si el usuario puede entrar en la aplicacion de almacen con ese movil
*
* */
/*DECLARE vIsGranted BOOLEAN;
DECLARE vDeviceProductionFk INT(11) DEFAULT NULL;
SELECT dp.id INTO vDeviceProductionFk
FROM vn.deviceProduction dp
WHERE dp.android_id = android_id;
IF vDeviceProductionFk THEN
SELECT COUNT(*) INTO vIsGranted
FROM vn.deviceProductionUser dpu
WHERE dpu.userFk = vUserFK
AND dpu.deviceProductionFk = vDeviceProductionFk;
RETURN vIsGranted;
END IF;*/
RETURN TRUE;
END$$
DELIMITER ;