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

30 lines
737 B
MySQL
Raw Permalink Normal View History

DELIMITER $$
2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`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 ;