Release ObjectStore 0.0.9
This commit is contained in:
1 parent
31eb4d092e
commit
0cf5c11202
39 files changed
+4739
-1167
No files matched your search
@@ -0,0 +1,25 @@
|
||||
package cloud.lunarsky.store;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
final class S3Access {
|
||||
private final ObjectStorage store;
|
||||
private final String owner;
|
||||
|
||||
S3Access(ObjectStorage store, String owner) {
|
||||
this.store = store;
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
String owner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
void requireOwner(String principal) {
|
||||
if (!owner.equals(principal)) throw new StoreException(403, "AccessDenied", "Access denied");
|
||||
}
|
||||
|
||||
void requireBucket(String bucket, String principal, int permission) throws IOException {
|
||||
Acl.require(store.bucket(bucket).acl(), principal, owner, permission);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user