Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7981653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:26:24+00:00 2026-06-04T10:26:24+00:00

I am trying to implement an IAM policy where A user can only have

  • 0

I am trying to implement an IAM policy where A user can only have access to the folder he is entitled too. I got this code from Amazon docs

Allow a user to list only the objects in his or her home directory in the corporate bucket

This example builds on the previous example that gives Bob a home directory. To give Bob the ability to list the objects in his home directory, he needs access to ListBucket. However, we want the results to include only objects in his home directory, and not everything in the bucket. To restrict his access that way, we use the policy condition key called s3:prefix with the value set to home/bob/. This means that only objects with a prefix home/bob/ will be returned in the ListBucket response.

{
  "Statement":[{
    "Effect":"Allow",
    "Action":"s3:ListBucket",
    "Resource":"arn:aws:s3:::my_corporate_bucket",
    "Condition":{
      "StringLike":{
      "s3:prefix":"home/bob/*"
    }
  }]
}

This is not working for me. When I run my code I am able to see all the folders and sub folders. My modified code looks something like this:

{
  "Statement":[{
    "Effect":"Allow",
    "Action":"s3:ListBucket",
    "Resource":"arn:aws:s3:::Test-test",
    "Condition":{
      "StringLike":{
      "s3:prefix":"Test/*"
    }
  }]
}

When I run my code in c# using the credentials of the user that is attached to the above policy I get all the folders and not just the one under “Test”…
Would really appreciate some help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T10:26:26+00:00Added an answer on June 4, 2026 at 10:26 am

    I finally got it working. Although I think there is a bug in AWS management console or atleast it seems like one. The problem is my policy was right all along the way but it behaved differently when I accessed it through AWS management console then softwares like CloudBErry. One thing I had to modify was ACL settings for objects and buckets.That too would have been done earlier had the AWS console worked properly. Anyways here is my policy:

    {
      "Statement": [
    
        {
          "Effect": "Allow",
          "Action": "s3:ListAllMyBuckets",
          "Resource": "arn:aws:s3:::*",
          "Condition": {}
        },
        {
          "Effect": "Allow",
          "Action": [
            "s3:ListBucket",
            "s3:ListBucketVersions"
          ],
          "Resource": "arn:aws:s3:::pa-test",
          "Condition": {
            "StringLike": {
              "s3:prefix": "test/*"
            }
          }
        },
        {
          "Effect": "Allow",
          "Action": "s3:*",
          "Resource": "arn:aws:s3:::pa-test/test/*",
          "Condition": {}
        }
      ]
    }
    

    1) The problem is when I access management console for this IAM user through AWS console I get access denied when I click on my bucket although when I log in through Cloudberry I can see my folders.
    2) I had to modify the ACL settings for my bucket and objects(folders)
    for my bucket:
    Owner : Full Control
    Authenticated Users : Readonly

    For my folders:
    Owner : Full Control

    Now the issue is that you cannot set ACl settings for folders(object) in AWS console. You can set them for files(object). For example if you right click on a folder(object) inside a bucket and then click properties it won’t show you a permission tabs. But if you right click on a bucket or a file(Say test.html) and click properties it will show you a permissions tab.
    I am not sure if someone else has noticed this issue. Anyways that is my script and it’s working now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Iam trying to implement a simple JMS(traditional not using springs) code in eclipse using
I have this weird kind of error. I am trying implement basic Euclidean algorithm
iam trying to implement an Searchmachine into my site. Iam using Zend_Search_Lucene for this.
I had been trying to implement OnTouchEvent so I can react when an user
I am trying to implement something like this: Clicking on a link, a pop-up
Found a really nice code for Accordion nav and am trying implement on our
Iam trying to implement HTTPS support with the help of curl. Since HTTPS is
I am trying to implement Python code I've written in Java and I want
I am trying implement the Data transformation using Reflection 1 example in my code.
I have been trying to implement Win32's MessageBox using GTK. The app uses SDL/OpenGL,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.