Skip to content

Commit

Permalink
fix build err
Browse files Browse the repository at this point in the history
  • Loading branch information
TCeason committed Feb 5, 2024
1 parent f621888 commit e76e478
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use databend_common_meta_app::principal::UserPrivilegeType::Ownership;
use databend_common_sql::plans::GrantPrivilegePlan;
use databend_common_users::RoleCacheManager;
use databend_common_users::UserApiProvider;
use databend_common_users::BUILTIN_ROLE_ACCOUNT_ADMIN;
use log::debug;
use log::error;
use log::info;
Expand Down
6 changes: 3 additions & 3 deletions src/query/users/src/role_mgr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,17 @@ impl UserApiProvider {
.get_ownership(object)
.await
.map_err(|e| e.add_message_back("(while get ownership)"))?;
if let Some(owenr) = ownership {
if let Some(owner) = ownership {
// if object has ownership, but the owner role is not exists, set owner role to ACCOUNT_ADMIN,
// only account_admin can access this object.
if !self.exists_role(tenant, owner.role.clone()).await? {
Ok(Some(OwnershipInfo {
role: BUILTIN_ROLE_ACCOUNT_ADMIN.to_string(),
object: *object,
object: object.clone(),
}))
} else {
Ok(Some(owner))
};
}
} else {
Ok(None)
}
Expand Down

0 comments on commit e76e478

Please sign in to comment.