How trully config conditions on Vue 3 / TS / Composition API? #799
Answered
by
romanhrynevych
romanhrynevych
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
romanhrynevych
Aug 14, 2023
Replies: 1 comment 1 reply
-
Hi Roman The problem with good documentation is that it tends to be big. Nowadays people are overloaded by amount of information and obviously skip reading or miss important information. Anyway, it’s easier to ask :) There is even a special term for this - help vampire. You can find information you need in this section - https://casl.js.org/v6/en/guide/intro#checking-logic when you check an actual object, casl needs to understand its type. If it’s just a POJO, there is no way to know it’s type in runtime. I’d recommend to carefully go through the guide and you will find all answers to your questions. Glory to heroes! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, sorry, read docs one more time and everything works now, problem was in "Subject type detection" and how exactly I need to provide it to CASL. So if anyone will face this problem next time, everything you need to do -> wrap your user object inside
subject
function, to provide type declaration 👇Link to docs: https://casl.js.org/v6/en/guide/subject-type-detection
Some more words to you personally @stalniy : Дуже дякую за таку чудову бібліотеку, радий що такий продукт зроблений українцем для всього світу! Гарного Вам дня та всього найкращого!