Decides whether user may perform action on target. Replaces the default policy — compose with defaultCommentPolicy to keep it. Use it to tie a thread to the access rules of the resource it discusses (a confidential matter's comments are as confidential as the matter).
basalt / comments/src / CommentRoutesOptions
Interface: CommentRoutesOptions
Defined in: comments/src/plugin.ts:76
Properties
authorize?
>
optionalauthorize?: (action,target,user) =>boolean|Promise<boolean>Defined in: comments/src/plugin.ts:83
Decides whether
usermay performactionontarget. Replaces the default policy — compose with defaultCommentPolicy to keep it. Use it to tie a thread to the access rules of the resource it discusses (a confidential matter's comments are as confidential as the matter).Parameters
action
CommentActiontarget
CommentTargetuser
CommentRouteUserReturns
boolean|Promise<boolean>