forked from Bubble-Protocol/bubble-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAccessControlledStorage.sol
38 lines (32 loc) · 1.51 KB
/
AccessControlledStorage.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* AccessControlledStorage interface
*
* Any smart contract that implements this interface can control off-chain storage using the
* Bubble Protocol.
*/
interface AccessControlledStorage {
/**
* Provides the access permissions for off-chain content controlled by this contract. An
* off-chain storage service calls this method to obtain a specific user's permissions for
* accessing a given file or directory. The method must return a bit field, with POSIX-like
* bits for terminated, directory, read, write, append and execute (tdrwax).
*
* See AccessControlBits.sol for a complete definition of the bit field returned by this
* method.
*
* Note, the following content IDs are reserved:
*
* CID Purpose
* --- ------------------------------------------------------------------------------------------
* 0 The root of the bubble itself. Any user with write permission to id 0 can construct the
* bubble on an off-chain storage service. Any user with read permission can list the
* contents of the bubble's root directory. ID 0 is always considered a directory and so the
* Directory Bit permission returned by this contract is ignored.
*
* @param user the user requesting access
* @param contentId the id of the content (file or directory) being requested
*/
function getAccessPermissions( address user, uint256 contentId ) external view returns (uint256);
}