pub trait PermissionChecker: Send + Sync {
// Required methods
fn check_permission(
&self,
user_info: UserInfoRef,
req: PermissionReq<'_>,
) -> Result<PermissionResp>;
fn check_permission_with_table_targets(
&self,
user_info: UserInfoRef,
req: PermissionReq<'_>,
targets: PermissionTableTargets,
) -> Result<PermissionResp>;
// Provided methods
fn check_permission_with_context(
&self,
user_info: UserInfoRef,
req: PermissionReq<'_>,
_current_schema: Option<&str>,
) -> Result<PermissionResp> { ... }
fn uses_table_targets(&self) -> bool { ... }
}Required Methods§
fn check_permission( &self, user_info: UserInfoRef, req: PermissionReq<'_>, ) -> Result<PermissionResp>
Sourcefn check_permission_with_table_targets(
&self,
user_info: UserInfoRef,
req: PermissionReq<'_>,
targets: PermissionTableTargets,
) -> Result<PermissionResp>
fn check_permission_with_table_targets( &self, user_info: UserInfoRef, req: PermissionReq<'_>, targets: PermissionTableTargets, ) -> Result<PermissionResp>
Checks the operation privilege and its resolved user-visible table targets.
PermissionTableTargets::Resolved with an empty vector still requires
checking the operation privilege in req, but has no table ACLs to check.
ACL-aware implementations must apply any admin bypass first, then reject
PermissionTableTargets::Unresolved for non-admin users.
Provided Methods§
fn check_permission_with_context( &self, user_info: UserInfoRef, req: PermissionReq<'_>, _current_schema: Option<&str>, ) -> Result<PermissionResp>
Sourcefn uses_table_targets(&self) -> bool
fn uses_table_targets(&self) -> bool
Returns whether authorization depends on resolved table targets.
The conservative default keeps target resolution enabled. Implementations
may return false only when their authorization result is independent of
the targets passed to Self::check_permission_with_table_targets.