Skip to main content

is_user_global_admin

Function is_user_global_admin 

Source
pub async fn is_user_global_admin(
    conn: &mut PgConnection,
    user_id: Uuid,
) -> Result<bool, AuthorizationError>
Expand description

Whether the user holds a global admin role.

Answers the same question as authorize(Administrate, GlobalPermissions), as a boolean for the callers that branch on admin status rather than gate on it. Errors only when the user’s roles cannot be fetched.