Skip to content

Introduce Transient Permission in Access Controller#393

Merged
kingster-will merged 2 commits intostoryprotocol:mainfrom
kingster-will:feat/one-time-permission
Feb 4, 2025
Merged

Introduce Transient Permission in Access Controller#393
kingster-will merged 2 commits intostoryprotocol:mainfrom
kingster-will:feat/one-time-permission

Conversation

@kingster-will
Copy link
Copy Markdown
Collaborator

Description

This PR introduces transient permissions in the Access Controller, allowing users to set one-time use permissions that only take effect in the current transaction. This feature enhances the flexibility and security of the permission management system.

Key Changes

  • Transient Permission Implementation: Added functionality to set and check transient permissions that are valid only for the current transaction.

@kingster-will
Copy link
Copy Markdown
Collaborator Author

Hey @berndartmueller,
Could you please help to review this PR?

@berndartmueller
Copy link
Copy Markdown

Hey @berndartmueller, Could you please help to review this PR?

Hey @kingster-will! Sure, I'm just a bit behind on chores, so please allow me some time to review it. I'll try to get to it next week.

@berndartmueller
Copy link
Copy Markdown

Hey @kingster-will! I reviewed the changes and have a question.

I noticed that once a transient permission is set in the current tx, it's not possible anymore that a previously set (permanent) permission is used during this very same tx. checkPermission(..) only verifies transient permissions due to _usingTransientPermission() returning true once a transient permission is set. Is this intentional?

@kingster-will
Copy link
Copy Markdown
Collaborator Author

Hey @kingster-will! I reviewed the changes and have a question.

I noticed that once a transient permission is set in the current tx, it's not possible anymore that a previously set (permanent) permission is used during this very same tx. checkPermission(..) only verifies transient permissions due to _usingTransientPermission() returning true once a transient permission is set. Is this intentional?

Hey @berndartmueller ,

Yes, this is intentional. When the IP owner sets a one-time (transient) permission in the current transaction, all permanent permissions are ignored for that transaction. This prevents confusion when checking permissions by avoiding the combination of transient and permanent permissions, ensuring straightforward permission management.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants