pub fn validate_grant_privileges(object: &GrantObject, privileges: UserPrivilegeSet) -> Result<()> {
    let available_privileges = object.available_privileges();
    let ok = privileges
        .iter()
        .all(|p| available_privileges.has_privilege(p));
    if !ok {
        return Err(common_exception::ErrorCode::IllegalGrant("Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be used"));
    }
    Ok(())
}
/// Check if there's any privilege which can not be granted to this GrantObject.
/// Some global privileges can not be granted to a database or table, for example,
/// a KILL statement is meaningless for a table.
Check if there's any privilege which can not be granted to this GrantObject.
Some global privileges can not be granted to a database or table, for example,
a KILL statement is meaningless for a table.
Check if there ' s any privilege which can not be granted to this GrantObject . Some global privileges can not be granted to a database or table for example a KILL statement is meaningless for a table .
pub fn validate_grant_privileges(object: &GrantObject, privileges: UserPrivilegeSet) -> Result<()> {
    let available_privileges = object.available_privileges();
    let ok = privileges
        .iter()
        .all(|p| available_privileges.has_privilege(p));
    if !ok {
        return Err(common_exception::ErrorCode::IllegalGrant("Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be used"));
    }
    Ok(())
}
pub fn validate_grant_privileges ( object : & GrantObject , privileges : UserPrivilegeSet ) -> Result < ( ) > { let available_privileges = object . available_privileges ( ) ; let ok = privileges . iter ( ) . all ( | p | available_privileges . has_privilege ( p ) ) ; if ! ok { return Err ( common_exception :: ErrorCode :: IllegalGrant ( " " ) ) ; } Ok ( ( ) ) }
Check if there's any privilege which can not be granted to this GrantObject.
Check if there ' s any privilege which can not be granted to this GrantObject .
object
&GrantObject
privileges
UserPrivilegeSet