eos icon indicating copy to clipboard operation
eos copied to clipboard

permissioned data access

Open yashvadhvani opened this issue 8 years ago • 9 comments

Is it possible to have permissioned data access? Suppose I am having a multi_index table and whoever adds data to that table only can access the data because I am having a table storage and one account named "myaccount" has added an entry but everyone else can access that data by doing cleos get table? Is there any way to change this or any other way to achieve permissioned data access?

yashvadhvani avatar Oct 04 '18 06:10 yashvadhvani

cleos get table doesn't check any permission to be executed. You may hide table abi from contract (cleos get table will not work) and add read action for permissioned access. (It would consume resources for reading data from table)

conr2d avatar Oct 04 '18 09:10 conr2d

how exactly i can do this first part i have done second part i don't know how to do can you please show me an example ?

yashvadhvani avatar Oct 04 '18 09:10 yashvadhvani

I've tested my method, but found that regardless of removing table abi, other contract can access table data with proper code, scope, tablename. Sorry for wrong information. In that case, permissioned access may not be possible. (Other contract can access by code anytime)

conr2d avatar Oct 04 '18 09:10 conr2d

can you please show me the test case because this may be what i am looking for.

yashvadhvani avatar Oct 04 '18 09:10 yashvadhvani

You can't forbid people from reading your data. By removing ABI, cleos get table will not work, but others can deploy his own contract which have table with code, scope, tablename corresponding to yours and read table by code. Refer to the next. https://eosio.stackexchange.com/questions/2149/can-we-add-the-permission-to-access-the-table

conr2d avatar Oct 04 '18 09:10 conr2d

how to perform read operation without a table as you mentioned before i have done this with update add and delete

yashvadhvani avatar Oct 04 '18 09:10 yashvadhvani

There's a misunderstanding. Table is necessary, but not by exposing table abi (omitting /// @abi table blahblah), you can disable cleos get table, but cleos only. People still can access your data by code.

conr2d avatar Oct 04 '18 10:10 conr2d

Ok Thank you sir @conr2d

yashvadhvani avatar Oct 04 '18 10:10 yashvadhvani

As pointed out, all data in tables are public.

heifner avatar Oct 04 '18 12:10 heifner