Deploy HickLab3D Dashboard / Deploy to production (push) Failing after 23s
Replace the old touchmark/PNG identity with the supplied lockup and monogram, segmented role-aware navigation, Live/Draft listing filters with generation-based cache invalidation, and admin Projects covering immutable file revisions, listing live pointers, and exact-decimal filament/packaging/shipping costing. Additive schema only; no Etsy publication. Isolated clone tests: 301 tests, 1162 assertions.
59 lines
1.3 KiB
PHP
59 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Policies;
|
|
|
|
use App\Models\Project;
|
|
use App\Models\User;
|
|
|
|
/**
|
|
* Projects and their commercial/cost/file/link/release actions are admin-only
|
|
* for this initial slice, matching existing Etsy/Shipping/Settings access.
|
|
*/
|
|
class ProjectPolicy
|
|
{
|
|
public function viewAny(User $user): bool
|
|
{
|
|
return $user->role === 'admin';
|
|
}
|
|
|
|
public function view(User $user, Project $project): bool
|
|
{
|
|
return $user->role === 'admin';
|
|
}
|
|
|
|
public function create(User $user): bool
|
|
{
|
|
return $user->role === 'admin';
|
|
}
|
|
|
|
public function update(User $user, Project $project): bool
|
|
{
|
|
return $user->role === 'admin';
|
|
}
|
|
|
|
public function archive(User $user, Project $project): bool
|
|
{
|
|
return $user->role === 'admin';
|
|
}
|
|
|
|
public function manageFiles(User $user, Project $project): bool
|
|
{
|
|
return $user->role === 'admin';
|
|
}
|
|
|
|
public function manageListings(User $user, Project $project): bool
|
|
{
|
|
return $user->role === 'admin';
|
|
}
|
|
|
|
public function manageCosts(User $user, Project $project): bool
|
|
{
|
|
return $user->role === 'admin';
|
|
}
|
|
|
|
public function release(User $user, Project $project): bool
|
|
{
|
|
return $user->role === 'admin';
|
|
}
|
|
}
|