15 lines
364 B
SQL
15 lines
364 B
SQL
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 ;
|