chore: auto-commit perubahan selesai
This commit is contained in:
@@ -29,24 +29,12 @@ class ActivityPolicy
|
|||||||
|
|
||||||
public function update(AuthUser $authUser, Activity $activity): bool
|
public function update(AuthUser $authUser, Activity $activity): bool
|
||||||
{
|
{
|
||||||
if ($authUser->can('Update:Activity')) {
|
return $authUser->can('Update:Activity');
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $authUser->hasRole('koordinator')
|
|
||||||
&& $activity->created_by === $authUser->id
|
|
||||||
&& is_null($activity->approved_at);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete(AuthUser $authUser, Activity $activity): bool
|
public function delete(AuthUser $authUser, Activity $activity): bool
|
||||||
{
|
{
|
||||||
if ($authUser->can('Delete:Activity')) {
|
return $authUser->can('Delete:Activity');
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $authUser->hasRole('koordinator')
|
|
||||||
&& $activity->created_by === $authUser->id
|
|
||||||
&& is_null($activity->approved_at);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteAny(AuthUser $authUser): bool
|
public function deleteAny(AuthUser $authUser): bool
|
||||||
|
|||||||
Reference in New Issue
Block a user