Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify permissions for REST params #354

Open
andersfylling opened this issue Nov 25, 2020 · 0 comments
Open

Specify permissions for REST params #354

andersfylling opened this issue Nov 25, 2020 · 0 comments

Comments

@andersfylling
Copy link
Owner

REST requests usually have a set of permissions for usage. However, some might depends on what params you specify.

The idea here is client side permission checking. Each param type must implement PermissionHolder:

type PermissionHolder interface {
	Permissions() PermissionBit
}

Base permission should be hardcoded in the REST method itself. This only deals with permissions related to the parameters.

Cons:

  • No way to externally verify if you have required permissions. I'm uncertain if this is a issue, but a quick extraction method (based on func pointer) can be introduced later on.

Pros:

  • client side verification, no waste of rate limits and fails quicker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant