salix/db/routines/account/functions/myUser_hasRoleId.sql

15 lines
364 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `account`.`myUser_hasRoleId`(vRoleId INT)
RETURNS tinyint(1)
DETERMINISTIC
BEGIN
/**
* Checks if current user has/inherits a role.
*
* @param vRoleName Role id to check
* @return %TRUE if it has role, %FALSE otherwise
*/
RETURN user_hasRoleId(myUser_getName(), vRoleId);
END$$
DELIMITER ;