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

enable voting for other permissions than @active #5

Open
rakeden opened this issue Jan 11, 2023 · 6 comments
Open

enable voting for other permissions than @active #5

rakeden opened this issue Jan 11, 2023 · 6 comments

Comments

@rakeden
Copy link
Collaborator

rakeden commented Jan 11, 2023

Currently signing a vote is limited to @Active permission.
We need to change that urgently before jan, 16th

@kaefergeneral
Copy link

After checking the smart contract, I'm actually not sure on what level the active permission is enforced. Can you check the front-end?

@rakeden
Copy link
Collaborator Author

rakeden commented Jan 11, 2023

This is the whole transaction to vote:
https://github.com/wax-office-of-inspector-general/govboard/blob/main/src/middleware.js#L4

Currently the permission is hardcoded to @active

@rakeden
Copy link
Collaborator Author

rakeden commented Jan 11, 2023

The usual way is to use whatever permission the user is currently using to log into the dApp

Something like the following:

authorization: [
                {
                    actor: await activeUser.accountName,
                    permission: activeUser.requestPermission,
                },
],

Can we use any permission on the contract? @kaefergeneral

@kaefergeneral
Copy link

Yes, the contract just checks authorizations. So as long as the permission is not limited, it can be used. The contract is not enforcing an active permission.

@rakeden
Copy link
Collaborator Author

rakeden commented Jan 11, 2023

This is the whole transaction to vote: https://github.com/wax-office-of-inspector-general/govboard/blob/main/src/middleware.js#L4

Currently the permission is hardcoded to @active

Inside that transaction the users permission is already known and can be accessed the above mentioned way --> activeUser.requestPermission

@NKCSS
Copy link

NKCSS commented Jan 12, 2023

I changed the hardcoded permissions to use the one from the activeUser; but the PR was being weird. I should look into how I can cherry pick commits :D but when I look at what it wants to do, it just shows the 2 changed files, so it seems GH is just being a bit weird 😅

#6

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

No branches or pull requests

3 participants