Skip to content

Commit

Permalink
Merge pull request #114 from hellboy1975/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
hellboy1975 authored Jan 26, 2024
2 parents 46e6b46 + c6badaf commit 5a7253b
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 388 deletions.
45 changes: 1 addition & 44 deletions app/Policies/AttemptPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Policies;

use App\Models\User;
use App\Models\Attempt;
use App\Models\User;
use Illuminate\Auth\Access\HandlesAuthorization;

class AttemptPolicy
Expand All @@ -12,9 +12,6 @@ class AttemptPolicy

/**
* Determine whether the user can view any models.
*
* @param \App\Models\User $user
* @return bool
*/
public function viewAny(User $user): bool
{
Expand All @@ -23,10 +20,6 @@ public function viewAny(User $user): bool

/**
* Determine whether the user can view the model.
*
* @param \App\Models\User $user
* @param \App\Models\Attempt $attempt
* @return bool
*/
public function view(User $user, Attempt $attempt): bool
{
Expand All @@ -35,9 +28,6 @@ public function view(User $user, Attempt $attempt): bool

/**
* Determine whether the user can create models.
*
* @param \App\Models\User $user
* @return bool
*/
public function create(User $user): bool
{
Expand All @@ -46,10 +36,6 @@ public function create(User $user): bool

/**
* Determine whether the user can update the model.
*
* @param \App\Models\User $user
* @param \App\Models\Attempt $attempt
* @return bool
*/
public function update(User $user, Attempt $attempt): bool
{
Expand All @@ -58,10 +44,6 @@ public function update(User $user, Attempt $attempt): bool

/**
* Determine whether the user can delete the model.
*
* @param \App\Models\User $user
* @param \App\Models\Attempt $attempt
* @return bool
*/
public function delete(User $user, Attempt $attempt): bool
{
Expand All @@ -70,9 +52,6 @@ public function delete(User $user, Attempt $attempt): bool

/**
* Determine whether the user can bulk delete.
*
* @param \App\Models\User $user
* @return bool
*/
public function deleteAny(User $user): bool
{
Expand All @@ -81,10 +60,6 @@ public function deleteAny(User $user): bool

/**
* Determine whether the user can permanently delete.
*
* @param \App\Models\User $user
* @param \App\Models\Attempt $attempt
* @return bool
*/
public function forceDelete(User $user, Attempt $attempt): bool
{
Expand All @@ -93,9 +68,6 @@ public function forceDelete(User $user, Attempt $attempt): bool

/**
* Determine whether the user can permanently bulk delete.
*
* @param \App\Models\User $user
* @return bool
*/
public function forceDeleteAny(User $user): bool
{
Expand All @@ -104,10 +76,6 @@ public function forceDeleteAny(User $user): bool

/**
* Determine whether the user can restore.
*
* @param \App\Models\User $user
* @param \App\Models\Attempt $attempt
* @return bool
*/
public function restore(User $user, Attempt $attempt): bool
{
Expand All @@ -116,9 +84,6 @@ public function restore(User $user, Attempt $attempt): bool

/**
* Determine whether the user can bulk restore.
*
* @param \App\Models\User $user
* @return bool
*/
public function restoreAny(User $user): bool
{
Expand All @@ -127,10 +92,6 @@ public function restoreAny(User $user): bool

/**
* Determine whether the user can replicate.
*
* @param \App\Models\User $user
* @param \App\Models\Attempt $attempt
* @return bool
*/
public function replicate(User $user, Attempt $attempt): bool
{
Expand All @@ -139,13 +100,9 @@ public function replicate(User $user, Attempt $attempt): bool

/**
* Determine whether the user can reorder.
*
* @param \App\Models\User $user
* @return bool
*/
public function reorder(User $user): bool
{
return $user->can('reorder_attempt');
}

}
45 changes: 1 addition & 44 deletions app/Policies/CavePolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Policies;

use App\Models\User;
use App\Models\Cave;
use App\Models\User;
use Illuminate\Auth\Access\HandlesAuthorization;

class CavePolicy
Expand All @@ -12,9 +12,6 @@ class CavePolicy

/**
* Determine whether the user can view any models.
*
* @param \App\Models\User $user
* @return bool
*/
public function viewAny(User $user): bool
{
Expand All @@ -23,10 +20,6 @@ public function viewAny(User $user): bool

/**
* Determine whether the user can view the model.
*
* @param \App\Models\User $user
* @param \App\Models\Cave $cave
* @return bool
*/
public function view(User $user, Cave $cave): bool
{
Expand All @@ -35,9 +28,6 @@ public function view(User $user, Cave $cave): bool

/**
* Determine whether the user can create models.
*
* @param \App\Models\User $user
* @return bool
*/
public function create(User $user): bool
{
Expand All @@ -46,10 +36,6 @@ public function create(User $user): bool

/**
* Determine whether the user can update the model.
*
* @param \App\Models\User $user
* @param \App\Models\Cave $cave
* @return bool
*/
public function update(User $user, Cave $cave): bool
{
Expand All @@ -58,10 +44,6 @@ public function update(User $user, Cave $cave): bool

/**
* Determine whether the user can delete the model.
*
* @param \App\Models\User $user
* @param \App\Models\Cave $cave
* @return bool
*/
public function delete(User $user, Cave $cave): bool
{
Expand All @@ -70,9 +52,6 @@ public function delete(User $user, Cave $cave): bool

/**
* Determine whether the user can bulk delete.
*
* @param \App\Models\User $user
* @return bool
*/
public function deleteAny(User $user): bool
{
Expand All @@ -81,10 +60,6 @@ public function deleteAny(User $user): bool

/**
* Determine whether the user can permanently delete.
*
* @param \App\Models\User $user
* @param \App\Models\Cave $cave
* @return bool
*/
public function forceDelete(User $user, Cave $cave): bool
{
Expand All @@ -93,9 +68,6 @@ public function forceDelete(User $user, Cave $cave): bool

/**
* Determine whether the user can permanently bulk delete.
*
* @param \App\Models\User $user
* @return bool
*/
public function forceDeleteAny(User $user): bool
{
Expand All @@ -104,10 +76,6 @@ public function forceDeleteAny(User $user): bool

/**
* Determine whether the user can restore.
*
* @param \App\Models\User $user
* @param \App\Models\Cave $cave
* @return bool
*/
public function restore(User $user, Cave $cave): bool
{
Expand All @@ -116,9 +84,6 @@ public function restore(User $user, Cave $cave): bool

/**
* Determine whether the user can bulk restore.
*
* @param \App\Models\User $user
* @return bool
*/
public function restoreAny(User $user): bool
{
Expand All @@ -127,10 +92,6 @@ public function restoreAny(User $user): bool

/**
* Determine whether the user can replicate.
*
* @param \App\Models\User $user
* @param \App\Models\Cave $cave
* @return bool
*/
public function replicate(User $user, Cave $cave): bool
{
Expand All @@ -139,13 +100,9 @@ public function replicate(User $user, Cave $cave): bool

/**
* Determine whether the user can reorder.
*
* @param \App\Models\User $user
* @return bool
*/
public function reorder(User $user): bool
{
return $user->can('reorder_cave');
}

}
Loading

0 comments on commit 5a7253b

Please sign in to comment.