Skip to content

Commit

Permalink
Merge branch '10.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed Jul 20, 2024
2 parents 36862f5 + 06438c7 commit b8f0ad2
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
50 changes: 50 additions & 0 deletions app/Nova/Policies/ProfilePolicy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

namespace App\Nova\Policies;

use App\Models\User;
use App\Nova\Profile;
use Illuminate\Auth\Access\Response;

class ProfilePolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return true;
}

/**
* Determine whether the user can view the model.
*/
public function view(User $user, Profile $profile): bool
{
return true;
}

/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return true;
}

/**
* Determine whether the user can update the model.
*/
public function update(User $user, Profile $profile): bool
{
return true;
}

/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, Profile $profile): bool
{
return false;
}
}
7 changes: 7 additions & 0 deletions app/Nova/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ class Profile extends Resource
*/
public static $model = \App\Models\Profile::class;

/**
* The policy the resource corrsponds to.
*
* @var class-string|null
*/
public static $policy = Policies\ProfilePolicy::class;

/**
* The single value that should be used to represent the resource when being displayed.
*
Expand Down

0 comments on commit b8f0ad2

Please sign in to comment.