2024-01-15 11:31:03 +00:00
|
|
|
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))
|
2024-01-15 11:31:03 +00:00
|
|
|
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 ;
|