Using feathers-casl
with feathers-pinia
and feathers Dove
- [How to define CASL rules]
- [Feathers-CASL Dove release v1.0.1]
- [Feathers-CASL Feathers-vuex documentation] (most of this comes from here)
casl @casl/ability@5 feathers-casl@pre
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
/* this is the first route hit */ | |
routeConfig.all('/*', (req, res, next) => { | |
req.sessionStore.get(req.session.id, (err, sess) => { | |
/* sess.user is set on login */ | |
if (sess && sess.user) { | |
/* logged in */ | |
} else { | |
/* not logged in */ | |
} |
routeConfig.post('/Dashboard/Index', repos.DashboardRepository.getRangeData(repos), (req, res) => { | |
let queries = [], | |
sess = req.userSession, | |
filter = req.rangeFilter; | |
queries.push(repos.PromotionRepository.getAgencyPromotions(sess.agencyId, 'all')); | |
queries.push(repos.DashboardRepository.getIndex(repos, filter, sess)); | |
queries.push(repos.PolicyRepository.getPolicies(filter, true)); | |
Promise.all(queries) |
import { Ref, ComputedRef } from 'vue' | |
interface ICommentFindOptions { | |
increment: number, | |
initialSize?: number | |
} | |
interface ICommentFindResult { | |
data: ComputedRef<Comment[]> | |
hasMoreComments: ComputedRef<boolean> |