feat: add feishu question preview services
This commit is contained in:
9
review_agent/feishu_questions/permissions.py
Normal file
9
review_agent/feishu_questions/permissions.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
def can_access_batch(user, batch) -> bool:
|
||||
if not user or not getattr(user, "is_authenticated", False):
|
||||
return False
|
||||
if getattr(user, "is_staff", False) or getattr(user, "is_superuser", False):
|
||||
return True
|
||||
return getattr(batch, "user_id", None) == user.pk
|
||||
Reference in New Issue
Block a user