支持自部署需求管理、交付流程与飞书集成
This commit is contained in:
1 parent
4556a5b483
commit
e22b66d9dd
148 files changed
+8300
-6393
No files matched your search
@@ -0,0 +1,11 @@
|
||||
import type { AuthUser } from './auth.ts';
|
||||
|
||||
export type DemandViewer = Pick<AuthUser, 'userId' | 'role'>;
|
||||
|
||||
// Read access only: admin visibility must never grant business/developer writes.
|
||||
// The owner can read drafts; everyone else's access requires a formal demand.
|
||||
export const readableDemandWhere = "(owner_id = ? OR (json_extract(payload, '$.status') != '草稿' AND (? = 1 OR json_extract(payload, '$.review.developer.userId') = ?)))";
|
||||
|
||||
export function readableDemandBindings(user: DemandViewer): [string, number, string] {
|
||||
return [user.userId, user.role === 'admin' ? 1 : 0, user.userId];
|
||||
}
|
||||
Reference in new issue
Block a user