LJ::check_priv — Check to see if a user has a certain privilege.
LJ::check_priv(u, priv, arg
u. A hashref of a row from the user table, sometimes called a "user object". Although only initially a row from the user table, gets a lot of tacked onto it from various other LJ API functions.
priv. Priv name to check for (see priv_list)
arg. Optional argument. If defined, function only returns true when $remote has a priv of type $priv also with arg $arg, not just any priv of type $priv, which is the behavior without an $arg. Arg can be "*", for all args.
Usually this is used to check the privs of a $remote user. See LJ::get_remote. As such, a $u argument of undef is okay to pass: 0 will be returned, as an unknown user can't have any rights.