How trully config conditions on Vue 3 / TS / Composition API? #799
-
Beta Was this translation helpful? Give feedback.
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.
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 : Дуже дякую за таку чудову бібліотеку, радий що такий продукт зроблений українцем для всього світу! Гарного Вам дня та всього найкращого!