-
Notifications
You must be signed in to change notification settings - Fork 6
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
Ks 2021 12 token voting permissions #4106
Conversation
@fuzzylogic2000 Now I remember why I also wanted to add the phase to the serializer, we also use the isVotingPhase for not showing the ratings here:
Not sure how to deal with it if not with serializer info, do you have an idea? |
So, the decision was to just keep it in the template tag for now, right? |
Yes! Should I write an issue to think about moving it to the api? |
…ed to check if voting is on the right module
75d97e9
to
ce36b85
Compare
…ions in TokenVoteMixin to get api permissions based on token right
6e91d5f
to
d764239
Compare
Coverage reportTotal coverage
Show files with reduced coverage 🔻Reduced coverage
Report generated by 🧪jest coverage report action from 1267280 |
d764239
to
1267280
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
install and passing tests but vote button functioonality no longer working, is this expected?
@phillimorland No, that should work still! What does it say in the network tab? |
@Rineee ignore me, I forgot I had to re-enter my token :p however I will add that we must disable hover styling on the disabled vote button |
I did some more research and decided to not use rules for the token voting api permissions as rules are dependent on users and arent really useful here.
I instead introduced a new Permission class, called TokenVotePermission that checks manually the relevant requirements on the token for create and destroy actions.
Also, I added a check in TokenVoteMixin to make sure that the token is valid before anything else is checked.