feat: права и инвайты
This commit is contained in:
@@ -10,13 +10,17 @@ log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
async def get_views_history(self: 'Usecase', input: dto.GetViewsHistoryInput) -> dto.GetViewsHistoryOutput:
|
||||
await self.ensure_workspace_access(input.workspace_id, input.user_id)
|
||||
context = await self.ensure_workspace_permission(
|
||||
input.workspace_id, input.user_id, domain.PermissionKey.PLACEMENTS_READ
|
||||
)
|
||||
|
||||
placement = await self.database.get_placement(input.workspace_id, input.placement_id)
|
||||
if not placement:
|
||||
log.warning('Placement %s not found for user %s', input.placement_id, input.user_id)
|
||||
raise domain.PlacementNotFound(input.placement_id)
|
||||
|
||||
context.ensure_project_permission(domain.PermissionKey.PLACEMENTS_READ, placement.project_id)
|
||||
|
||||
histories = await self.database.get_views_history(
|
||||
input.placement_id,
|
||||
from_date=input.from_date,
|
||||
|
||||
Reference in New Issue
Block a user