chore: Use types from the web package

This commit is contained in:
Faruk AYDIN
2024-01-15 13:30:48 +01:00
parent 7831f2925b
commit 159931a6ea
77 changed files with 934 additions and 378 deletions

View File

@@ -1,5 +1,9 @@
import { PureAbility, fieldPatternMatcher, mongoQueryMatcher } from '@casl/ability';
import { IUser } from '@automatisch/types';
import {
PureAbility,
fieldPatternMatcher,
mongoQueryMatcher,
} from '@casl/ability';
import { IUser } from 'types';
// Must be kept in sync with `packages/backend/src/helpers/user-ability.ts`!
export default function userAbility(user: IUser) {
@@ -9,7 +13,7 @@ export default function userAbility(user: IUser) {
// We're not using mongo, but our fields, conditions match
const options = {
conditionsMatcher: mongoQueryMatcher,
fieldMatcher: fieldPatternMatcher
fieldMatcher: fieldPatternMatcher,
};
if (!role || !permissions) {