Skip to content

Commit

Permalink
chore: remove AC on get_bucket_info API
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Oct 25, 2024
1 parent cfeed3a commit f895eb4
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/ic_oss_bucket/src/api_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ fn api_version() -> u16 {
}

#[ic_cdk::query]
fn get_bucket_info(access_token: Option<ByteBuf>) -> Result<BucketInfo, String> {
let canister = ic_cdk::id();
let ctx = match store::state::with(|s| {
s.read_permission(
ic_cdk::caller(),
&canister,
access_token,
ic_cdk::api::time() / SECONDS,
)
}) {
Ok(ctx) => ctx,
Err((_, err)) => {
return Err(err);
}
};
fn get_bucket_info(_access_token: Option<ByteBuf>) -> Result<BucketInfo, String> {
// let canister = ic_cdk::id();
// let ctx = match store::state::with(|s| {
// s.read_permission(
// ic_cdk::caller(),
// &canister,
// access_token,
// ic_cdk::api::time() / SECONDS,
// )
// }) {
// Ok(ctx) => ctx,
// Err((_, err)) => {
// return Err(err);
// }
// };

if !permission::check_bucket_read(&ctx.ps, &canister) {
return Err("permission denied".to_string());
}
// if !permission::check_bucket_read(&ctx.ps, &canister) {
// return Err("permission denied".to_string());
// }

Ok(store::state::with(|r| BucketInfo {
name: r.name.clone(),
Expand Down

0 comments on commit f895eb4

Please sign in to comment.