dhiway / cord

CORD - Enterprise Blockchain Framework
https://cord.network
GNU General Public License v3.0
161 stars 112 forks source link

statement: Disallow delegate-2 to revoke/update delegate-1's statement #524

Open vatsa287 opened 1 week ago

vatsa287 commented 1 week ago

<Demo PR>, <Do Not Merge>

Example:

  1. Creator creates a chainspace.
  2. Adds a delegate delegate-1 with ASSERT permission.
  3. Adds a delegate delegate-2 with ASSERT permission.
  4. Create a statement statement-1 from delegate-1.
  5. Create a statement statement-2 from delegate-2.
  6. Try revoking/edit statement-1 from delegate-2 or vice versa. ( Should this be allowed, currently this followed in DeDir too).
vatsa287 commented 1 week ago

@smohan-dw @amarts I needed your insights on above.

If this should be allowed we can something like below in entries/ statement.

  1. Check if the origin has a admin authorisation of the chainspace/ registry.
  2. Check if the origin is the creator, creator is stored during creation of the statement/ entry.
  3. Allow only if any one of above is true, disallow else.
smohan-dw commented 1 week ago

The delegates should be able to do any operations on the entries posted by other delegates. Only the registry admins should have that capability. Also make sure we are checking for a delegate permissions for revoke operation. Not all delegates have this permission. Go ahead and make the changes needed for this.