30 lines
737 B
SQL
30 lines
737 B
SQL
DELIMITER $$
|
|
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 ;
|