hi all, I have been working on authorizations late...
# avo-2
l
hi all, I have been working on authorizations lately, following the docs here: https://docs.avohq.io/2.0/authorization.html I achieved the behavior I wanted, everything is working fine until I deploy. There is an issue I cannot reproduce: I have two roles (data manager and user), data manager can create, edit and destroy a record while user can only view it. Locally, it works all as intended, but as soon as I deploy, when I log in as a user, for some records I see the edit and destroy icons, but when I click on them I get the notification "you are not authorized to perform this action". It seems that I am missing something central in my implementation, but I cannot find out what. Has someone experienced a similar issue? How did you go about it? Thanks!
l
hey there
are you on the
pro
license?
authorization is a pro feature
l
yes
l
are you 100% sure that the production env is using a pro feature? do you use dashboards or a custom field/resource tool?
something to validate that?
l
yes, I use dashboards and they work fine
l
ok. cool
thanks for confirming that
hmm
ok. then the next thing we should do is make sure that the user you think is logged is actually logged in and has the appropiate roles/permissions
so, you could log to the console or something the
user
object from the policy
maybe the user roles too or the properties you are setting the perimissions to true/false
I don't think this is an Avo issue, but something related to the authentication system
l
is there a private chat where I can send you the link to my app, so that you could log in and see the behavior by yourself? I asked my colleague and we are both very surprised by the issue
l
we could do that in the DM, but I don't know how I could help from looking at the public page
l
I can provide a test login
what surprises me is that in my current example, the editing icon (the pen) is shown, but when I go to the details page of the record, the "edit" button is not present
l
yes, but I can't see what the
user
object is...
what I would do is log it to the console and watch that so see the user and the roles
hmmm
please open a ticket on github with a screenshot or recording
there might be some information that I missed here
l
yes ok, I will do this
l
thank you!
l
thank you for the help. I will have to look deeper into this issue, it seems there is something quite fishy... Once I have identified it and isolated the issue, if still needed, I will create the issue as you said. Thanks!
l
ok. thanks for letting me know
this is what I'd do
you'll find out very quickly what's happening and where the issues comes from
l
super, thank you very much. Your support is amazing an always very much appreciated