import { IUser , IPost } from '@cc98/api' ; export function judgeEdit ( myInfo , userInfo , postInfo , boardMasters ) { if ( ( myInfo && myInfo . id ) === ( userInfo && userInfo . id ) || postInfo . isAnonymous ) return true ; if ( myInfo && ( myInfo . privilege === '管理员' || myInfo . privilege === '超级版主' ) ) return true ; if ( userInfo && ( userInfo . privilege === '管理员' || userInfo . privilege === '超级版主' ) ) { return false ; } if ( myInfo && boardMasters . indexOf ( myInfo . name ) !== - 1 ) return true ; return false ; } export function judgeManager ( myInfo ) { if ( myInfo && ( myInfo . privilege === '管理员' || myInfo . privilege === '超级版主' ) ) return true ; return false ; } export function judgeManagerOrBoardMasters ( myInfo , boardMasters ) { if ( myInfo && ( myInfo . privilege === '管理员' || myInfo . privilege === '超级版主' ) ) return true ; if ( myInfo && boardMasters . indexOf ( myInfo . name ) !== - 1 ) return true ; return false ; }