Skip to content
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant