15 lines
370 B
MySQL
15 lines
370 B
MySQL
|
DELIMITER $$
|
||
|
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `account`.`myUser_hasRole`(vRoleName VARCHAR(255))
|
||
|
RETURNS tinyint(1)
|
||
|
DETERMINISTIC
|
||
|
BEGIN
|
||
|
/**
|
||
|
* Checks if current user has/inherits a role.
|
||
|
*
|
||
|
* @param vRoleName Role to check
|
||
|
* @return %TRUE if it has role, %FALSE otherwise
|
||
|
*/
|
||
|
RETURN user_hasRole(myUser_getName(), vRoleName);
|
||
|
END$$
|
||
|
DELIMITER ;
|