src/snac/server/database/DBUser.php
/**
     * Does user have a privilege, by label
     *
     * Returns true if the privilege with $label exists. Build a list of all the privilege labels, then test
     * the list for key existence.
     *
     * @param \snac\data\User $user User object for which to check privileges
     * @param string $label Symbolic label of a privilege.
     * @return boolean True if the $user has $privilege in any of the roles, return false otherwise.
     */
Does user have a privilege, by label
Returns true if the privilege with $label exists. Build a list of all the privilege labels, then test
the list for key existence.

@param \snac\data\User $user User object for which to check privileges
@param string $label Symbolic label of a privilege.
@return boolean True if the $user has $privilege in any of the roles, return false otherwise.
Does user have a privilege by label Returns true if the privilege with $label exists . Build a list of all the privilege labels then test the list for key existence . @param \ snac \ data \ User $user User object for which to check privileges @param string $label Symbolic label of a privilege . @return boolean True if the $user has $privilege in any of the roles return false otherwise .
public function hasPrivilegeByLabel($user, $label)
    {
        $allPrivs = array(); 
        foreach($user->getRoleList() as $userRole)
        {
            foreach($userRole->getPrivilegeList() as $priv)
            {
                $allPrivs[$priv->getLabel()] = 1;
            }
        }
        return isset($allPrivs[$label]);
    }
public function hasPrivilegeByLabel ( $ user , $ label ) { $ allPrivs = array ( ) ; foreach ( $ user -> getRoleList ( ) as $ userRole ) { foreach ( $ userRole -> getPrivilegeList ( ) as $ priv ) { $ allPrivs [ $ priv -> getLabel ( ) ] = 1 ; } } return isset ( $ allPrivs [ $ label ] ) ; }
Does user have a privilege, by label
 Returns true if the privilege with $label exists.
Does user have a privilege by label Returns true if the privilege with $label exists .
// assoc list