Added the ability to add project information.

This commit is contained in:
2024-04-14 15:27:51 +05:00
parent b7d0a2453e
commit 2769585de0
35 changed files with 862 additions and 14 deletions
@@ -50,6 +50,23 @@ final class ProjectService extends Service
]);
}
public function show(int $id, User $user): ServiceResultError | ServiceResultArray
{
$project = $this->projectRepository->getProjectById($id);
if (is_null($project)) {
return $this->errNotFound(__('Not Found'));
}
if ($user->cannot('view', $project)) {
return $this->errFobidden(__('Access is denied'));
}
return $this->result([
'project' => $project,
]);
}
public function create(User $user): ServiceResultError | ServiceResultArray
{
if ($user->cannot('create', Project::class)) {