diff --git a/app/Policies/AssignmentPolicy.php b/app/Policies/AssignmentPolicy.php new file mode 100644 index 0000000..a527d32 --- /dev/null +++ b/app/Policies/AssignmentPolicy.php @@ -0,0 +1,69 @@ +can('ViewAny:Assignment'); + } + + public function view(AuthUser $authUser, Assignment $assignment): bool + { + return $authUser->can('View:Assignment'); + } + + public function create(AuthUser $authUser): bool + { + return $authUser->can('Create:Assignment'); + } + + public function update(AuthUser $authUser, Assignment $assignment): bool + { + return $authUser->can('Update:Assignment'); + } + + public function delete(AuthUser $authUser, Assignment $assignment): bool + { + return $authUser->can('Delete:Assignment'); + } + + public function restore(AuthUser $authUser, Assignment $assignment): bool + { + return $authUser->can('Restore:Assignment'); + } + + public function forceDelete(AuthUser $authUser, Assignment $assignment): bool + { + return $authUser->can('ForceDelete:Assignment'); + } + + public function forceDeleteAny(AuthUser $authUser): bool + { + return $authUser->can('ForceDeleteAny:Assignment'); + } + + public function restoreAny(AuthUser $authUser): bool + { + return $authUser->can('RestoreAny:Assignment'); + } + + public function replicate(AuthUser $authUser, Assignment $assignment): bool + { + return $authUser->can('Replicate:Assignment'); + } + + public function reorder(AuthUser $authUser): bool + { + return $authUser->can('Reorder:Assignment'); + } +} diff --git a/app/Policies/AttendancePolicy.php b/app/Policies/AttendancePolicy.php new file mode 100644 index 0000000..a5c6317 --- /dev/null +++ b/app/Policies/AttendancePolicy.php @@ -0,0 +1,69 @@ +can('ViewAny:Attendance'); + } + + public function view(AuthUser $authUser, Attendance $attendance): bool + { + return $authUser->can('View:Attendance'); + } + + public function create(AuthUser $authUser): bool + { + return $authUser->can('Create:Attendance'); + } + + public function update(AuthUser $authUser, Attendance $attendance): bool + { + return $authUser->can('Update:Attendance'); + } + + public function delete(AuthUser $authUser, Attendance $attendance): bool + { + return $authUser->can('Delete:Attendance'); + } + + public function restore(AuthUser $authUser, Attendance $attendance): bool + { + return $authUser->can('Restore:Attendance'); + } + + public function forceDelete(AuthUser $authUser, Attendance $attendance): bool + { + return $authUser->can('ForceDelete:Attendance'); + } + + public function forceDeleteAny(AuthUser $authUser): bool + { + return $authUser->can('ForceDeleteAny:Attendance'); + } + + public function restoreAny(AuthUser $authUser): bool + { + return $authUser->can('RestoreAny:Attendance'); + } + + public function replicate(AuthUser $authUser, Attendance $attendance): bool + { + return $authUser->can('Replicate:Attendance'); + } + + public function reorder(AuthUser $authUser): bool + { + return $authUser->can('Reorder:Attendance'); + } +} diff --git a/app/Policies/CoursePolicy.php b/app/Policies/CoursePolicy.php new file mode 100644 index 0000000..5c8ce02 --- /dev/null +++ b/app/Policies/CoursePolicy.php @@ -0,0 +1,69 @@ +can('ViewAny:Course'); + } + + public function view(AuthUser $authUser, Course $course): bool + { + return $authUser->can('View:Course'); + } + + public function create(AuthUser $authUser): bool + { + return $authUser->can('Create:Course'); + } + + public function update(AuthUser $authUser, Course $course): bool + { + return $authUser->can('Update:Course'); + } + + public function delete(AuthUser $authUser, Course $course): bool + { + return $authUser->can('Delete:Course'); + } + + public function restore(AuthUser $authUser, Course $course): bool + { + return $authUser->can('Restore:Course'); + } + + public function forceDelete(AuthUser $authUser, Course $course): bool + { + return $authUser->can('ForceDelete:Course'); + } + + public function forceDeleteAny(AuthUser $authUser): bool + { + return $authUser->can('ForceDeleteAny:Course'); + } + + public function restoreAny(AuthUser $authUser): bool + { + return $authUser->can('RestoreAny:Course'); + } + + public function replicate(AuthUser $authUser, Course $course): bool + { + return $authUser->can('Replicate:Course'); + } + + public function reorder(AuthUser $authUser): bool + { + return $authUser->can('Reorder:Course'); + } +} diff --git a/app/Policies/CourseSchedulePolicy.php b/app/Policies/CourseSchedulePolicy.php new file mode 100644 index 0000000..13e7b7b --- /dev/null +++ b/app/Policies/CourseSchedulePolicy.php @@ -0,0 +1,69 @@ +can('ViewAny:CourseSchedule'); + } + + public function view(AuthUser $authUser, CourseSchedule $courseSchedule): bool + { + return $authUser->can('View:CourseSchedule'); + } + + public function create(AuthUser $authUser): bool + { + return $authUser->can('Create:CourseSchedule'); + } + + public function update(AuthUser $authUser, CourseSchedule $courseSchedule): bool + { + return $authUser->can('Update:CourseSchedule'); + } + + public function delete(AuthUser $authUser, CourseSchedule $courseSchedule): bool + { + return $authUser->can('Delete:CourseSchedule'); + } + + public function restore(AuthUser $authUser, CourseSchedule $courseSchedule): bool + { + return $authUser->can('Restore:CourseSchedule'); + } + + public function forceDelete(AuthUser $authUser, CourseSchedule $courseSchedule): bool + { + return $authUser->can('ForceDelete:CourseSchedule'); + } + + public function forceDeleteAny(AuthUser $authUser): bool + { + return $authUser->can('ForceDeleteAny:CourseSchedule'); + } + + public function restoreAny(AuthUser $authUser): bool + { + return $authUser->can('RestoreAny:CourseSchedule'); + } + + public function replicate(AuthUser $authUser, CourseSchedule $courseSchedule): bool + { + return $authUser->can('Replicate:CourseSchedule'); + } + + public function reorder(AuthUser $authUser): bool + { + return $authUser->can('Reorder:CourseSchedule'); + } +} diff --git a/app/Policies/LecturerPolicy.php b/app/Policies/LecturerPolicy.php new file mode 100644 index 0000000..6f82ccb --- /dev/null +++ b/app/Policies/LecturerPolicy.php @@ -0,0 +1,69 @@ +can('ViewAny:Lecturer'); + } + + public function view(AuthUser $authUser, Lecturer $lecturer): bool + { + return $authUser->can('View:Lecturer'); + } + + public function create(AuthUser $authUser): bool + { + return $authUser->can('Create:Lecturer'); + } + + public function update(AuthUser $authUser, Lecturer $lecturer): bool + { + return $authUser->can('Update:Lecturer'); + } + + public function delete(AuthUser $authUser, Lecturer $lecturer): bool + { + return $authUser->can('Delete:Lecturer'); + } + + public function restore(AuthUser $authUser, Lecturer $lecturer): bool + { + return $authUser->can('Restore:Lecturer'); + } + + public function forceDelete(AuthUser $authUser, Lecturer $lecturer): bool + { + return $authUser->can('ForceDelete:Lecturer'); + } + + public function forceDeleteAny(AuthUser $authUser): bool + { + return $authUser->can('ForceDeleteAny:Lecturer'); + } + + public function restoreAny(AuthUser $authUser): bool + { + return $authUser->can('RestoreAny:Lecturer'); + } + + public function replicate(AuthUser $authUser, Lecturer $lecturer): bool + { + return $authUser->can('Replicate:Lecturer'); + } + + public function reorder(AuthUser $authUser): bool + { + return $authUser->can('Reorder:Lecturer'); + } +} diff --git a/app/Policies/MaterialPolicy.php b/app/Policies/MaterialPolicy.php new file mode 100644 index 0000000..5b6d707 --- /dev/null +++ b/app/Policies/MaterialPolicy.php @@ -0,0 +1,69 @@ +can('ViewAny:Material'); + } + + public function view(AuthUser $authUser, Material $material): bool + { + return $authUser->can('View:Material'); + } + + public function create(AuthUser $authUser): bool + { + return $authUser->can('Create:Material'); + } + + public function update(AuthUser $authUser, Material $material): bool + { + return $authUser->can('Update:Material'); + } + + public function delete(AuthUser $authUser, Material $material): bool + { + return $authUser->can('Delete:Material'); + } + + public function restore(AuthUser $authUser, Material $material): bool + { + return $authUser->can('Restore:Material'); + } + + public function forceDelete(AuthUser $authUser, Material $material): bool + { + return $authUser->can('ForceDelete:Material'); + } + + public function forceDeleteAny(AuthUser $authUser): bool + { + return $authUser->can('ForceDeleteAny:Material'); + } + + public function restoreAny(AuthUser $authUser): bool + { + return $authUser->can('RestoreAny:Material'); + } + + public function replicate(AuthUser $authUser, Material $material): bool + { + return $authUser->can('Replicate:Material'); + } + + public function reorder(AuthUser $authUser): bool + { + return $authUser->can('Reorder:Material'); + } +} diff --git a/app/Policies/RolePolicy.php b/app/Policies/RolePolicy.php new file mode 100644 index 0000000..1654cec --- /dev/null +++ b/app/Policies/RolePolicy.php @@ -0,0 +1,69 @@ +can('ViewAny:Role'); + } + + public function view(AuthUser $authUser, Role $role): bool + { + return $authUser->can('View:Role'); + } + + public function create(AuthUser $authUser): bool + { + return $authUser->can('Create:Role'); + } + + public function update(AuthUser $authUser, Role $role): bool + { + return $authUser->can('Update:Role'); + } + + public function delete(AuthUser $authUser, Role $role): bool + { + return $authUser->can('Delete:Role'); + } + + public function restore(AuthUser $authUser, Role $role): bool + { + return $authUser->can('Restore:Role'); + } + + public function forceDelete(AuthUser $authUser, Role $role): bool + { + return $authUser->can('ForceDelete:Role'); + } + + public function forceDeleteAny(AuthUser $authUser): bool + { + return $authUser->can('ForceDeleteAny:Role'); + } + + public function restoreAny(AuthUser $authUser): bool + { + return $authUser->can('RestoreAny:Role'); + } + + public function replicate(AuthUser $authUser, Role $role): bool + { + return $authUser->can('Replicate:Role'); + } + + public function reorder(AuthUser $authUser): bool + { + return $authUser->can('Reorder:Role'); + } +} diff --git a/app/Policies/StudentPolicy.php b/app/Policies/StudentPolicy.php new file mode 100644 index 0000000..5e2b56d --- /dev/null +++ b/app/Policies/StudentPolicy.php @@ -0,0 +1,69 @@ +can('ViewAny:Student'); + } + + public function view(AuthUser $authUser, Student $student): bool + { + return $authUser->can('View:Student'); + } + + public function create(AuthUser $authUser): bool + { + return $authUser->can('Create:Student'); + } + + public function update(AuthUser $authUser, Student $student): bool + { + return $authUser->can('Update:Student'); + } + + public function delete(AuthUser $authUser, Student $student): bool + { + return $authUser->can('Delete:Student'); + } + + public function restore(AuthUser $authUser, Student $student): bool + { + return $authUser->can('Restore:Student'); + } + + public function forceDelete(AuthUser $authUser, Student $student): bool + { + return $authUser->can('ForceDelete:Student'); + } + + public function forceDeleteAny(AuthUser $authUser): bool + { + return $authUser->can('ForceDeleteAny:Student'); + } + + public function restoreAny(AuthUser $authUser): bool + { + return $authUser->can('RestoreAny:Student'); + } + + public function replicate(AuthUser $authUser, Student $student): bool + { + return $authUser->can('Replicate:Student'); + } + + public function reorder(AuthUser $authUser): bool + { + return $authUser->can('Reorder:Student'); + } +} diff --git a/app/Policies/StudyGroupPolicy.php b/app/Policies/StudyGroupPolicy.php new file mode 100644 index 0000000..da9ada2 --- /dev/null +++ b/app/Policies/StudyGroupPolicy.php @@ -0,0 +1,69 @@ +can('ViewAny:StudyGroup'); + } + + public function view(AuthUser $authUser, StudyGroup $studyGroup): bool + { + return $authUser->can('View:StudyGroup'); + } + + public function create(AuthUser $authUser): bool + { + return $authUser->can('Create:StudyGroup'); + } + + public function update(AuthUser $authUser, StudyGroup $studyGroup): bool + { + return $authUser->can('Update:StudyGroup'); + } + + public function delete(AuthUser $authUser, StudyGroup $studyGroup): bool + { + return $authUser->can('Delete:StudyGroup'); + } + + public function restore(AuthUser $authUser, StudyGroup $studyGroup): bool + { + return $authUser->can('Restore:StudyGroup'); + } + + public function forceDelete(AuthUser $authUser, StudyGroup $studyGroup): bool + { + return $authUser->can('ForceDelete:StudyGroup'); + } + + public function forceDeleteAny(AuthUser $authUser): bool + { + return $authUser->can('ForceDeleteAny:StudyGroup'); + } + + public function restoreAny(AuthUser $authUser): bool + { + return $authUser->can('RestoreAny:StudyGroup'); + } + + public function replicate(AuthUser $authUser, StudyGroup $studyGroup): bool + { + return $authUser->can('Replicate:StudyGroup'); + } + + public function reorder(AuthUser $authUser): bool + { + return $authUser->can('Reorder:StudyGroup'); + } +}