public function hasRole($name)
    {
        if ($this->RoleID) {
            $role = new Role($this->RoleID);
            if ($role->RoleName == $name) {
                return true;
            }
        }

        foreach ($this->Roles as $role) {
            if ($role->RoleName == $name) {
                return true;
            }
        }
        return false;
    }
public function hasRole($name)
    {
        if ($this->RoleID) {
            $role = new Role($this->RoleID);
            if ($role->RoleName == $name) {
                return true;
            }
        }

        foreach ($this->Roles as $role) {
            if ($role->RoleName == $name) {
                return true;
            }
        }
        return false;
    }
public function hasRole ( $ name ) { if ( $ this -> RoleID ) { $ role = new Role ( $ this -> RoleID ) ; if ( $ role -> RoleName == $ name ) { return true ; } } foreach ( $ this -> Roles as $ role ) { if ( $ role -> RoleName == $ name ) { return true ; } } return false ; }
Checks if user has a specific role
@param $name string
@return bool
Checks if user has a specific role