Great thanks a lot, i didn’t get the fact that you will give 2 abilities. Thanks for your post it’s help a lot ! you should write a medium article
E
Latest posts made by Ender007
-
RE: [Solved] How to use CASL with Quasar
-
RE: [Solved] How to use CASL with Quasar
I have got a question:
Why have you define your abilities like this:' {"group_name": "Administration",' + ' "description": "Administer this application",' + ' "abilities": [' + ' {"name": "Administer manage", "subject": "Administer", "actions": "manage"}' + ' ]' + ' },
Instead of like this
' {"group_name": "Administration",' + ' "description": "Administer this application",' + ' "abilities": [' + ' {"name": "Administer manage users", "subject": "users", "actions": "manage"}' + ' {"name": "Administer manage users", "subject": "usage", "actions": "manage"}' + ' {"name": "Administer manage users", "subject": "reports", "actions": "manage"}' + ' {"name": "Administer manage users", "subject": "server", "actions": "manage"}' + ' ]' + ' },
And then in your index.js:
if (to.matched.some(record => record.path === '/reports')) { if (routeAbility.can('manage', 'users')) { next() } } if (to.matched.some(record => record.path === '/reports')) { if (routeAbility.can('manage', 'usage')) { next() } } if (to.matched.some(record => record.path === '/reports')) { if (routeAbility.can('manage', 'reports')) { next() } } if (to.matched.some(record => record.path === '/server')) { if (routeAbility.can('manage', 'server')) { next() } }
I need to understand because i want to give the ability to the user to create new group of user and then depending of the new ability the user can or cannot go to a route.
-
RE: Date Utils
state.PaieCalendar[0].EndPeriod = date.formatDate(
date.subtractFromDate(
date.startOfDate(date.addToDate(payload, { month: 1 }), “month”),
{ days: 1 }
),
“YYYY/MM/DD”
);
i found this but… -
Date Utils
When i use date.endOfDate(,‘month’). I got this error : TypeError: t.getFullYear is not a function.
i don’t get it because i use the date.startOfDate(,‘month’) it’s working…state.PaieCalendar[0].EndPeriod = date.formatDate( date.endOfDate(payload, "month"), "YYYY/MM/DD" );