[development] user_roles() at hook_boot()

Jamie Holly hovercrafter at earthlink.net
Tue Jan 12 13:55:47 UTC 2010


user_roles isn't loaded yet, but the global $user is populated and the 
roles are stored inside of that as an array, so you can do it as 
hook_boot, but you need to manually check the roles.

Jamie Holly
http://www.intoxination.net
http://www.hollyit.net


On 1/12/2010 7:56 AM, Lluís wrote:
> I need to check roles for a permission at hook_boot; but I recive a
> "Fatal error: Call to undefined function user_roles()". Is it possible
> that user_roles() is not defined at hook_boot? or am I missing
> something else?
>
> thanks.
>
>    


More information about the development mailing list