PHP Code:
stock access(id,level)
{
if (level==ADMIN_ADMIN)
{
return is_user_admin(id);
}
else if (level==ADMIN_ALL)
{
return 1;
}
return (get_user_flags(id) & level);
}
access prevents coder from making mistakes with flags, because not all coders know usages of ADMIN_ADMIN and ADMIN_ALL, and also it handles better situations where the admin level is hold by a variable.
So :
If you check admin access in a
command, use
cmd_access
Else use
access.
You may also need has_flag or has_all_flags in some situations.
__________________