Skip to content

Commit 36b331f

Browse files
committed
chore: credit adonis
1 parent 0562038 commit 36b331f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/utils/ability.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import type { BouncerAbility, BouncerAuthorizer, AuthorizationResponse, AuthorizerResponse } from './types'
22

3+
/**
4+
* @credit https://github.com/adonisjs/bouncer
5+
*/
36
export type AuthorizerToAbility<Authorizer> = Authorizer extends (
47
user: infer User,
58
...args: infer Args
@@ -13,6 +16,7 @@ export type AuthorizerToAbility<Authorizer> = Authorizer extends (
1316

1417
/**
1518
* Define an ability that you can use to check if a user can perform an action.
19+
* @credit https://github.com/adonisjs/bouncer
1620
*/
1721
export function defineAbility<Authorizer extends BouncerAuthorizer<any>>(
1822
authorizer: Authorizer,

0 commit comments

Comments
 (0)