diff --git a/app/Jobs/CreateXenForoCommentsThread.php b/app/Jobs/CreateXenForoCommentsThread.php new file mode 100644 index 0000000..0edeb09 --- /dev/null +++ b/app/Jobs/CreateXenForoCommentsThread.php @@ -0,0 +1,34 @@ +createCommentsThread($this->entry); + } +} diff --git a/app/Policies/EntryPolicy.php b/app/Policies/EntryPolicy.php new file mode 100644 index 0000000..1527128 --- /dev/null +++ b/app/Policies/EntryPolicy.php @@ -0,0 +1,39 @@ +_can( 'romhackplaza', 'view' ) ) + return true; + + return false; + } + + public function create(User $user, ?Entry $entry = null ): bool + { + return $user->_can( 'romhackplaza', 'canSubmitEntry' ); + } + + /** + * Determine whether the user can update the model. + */ + public function update(User $user, Entry $entry): bool + { + if( $user->_can('romhackplaza', 'canEditOthersEntries') ) + return true; + + if( $user->_can( 'romhackplaza', 'canEditMyEntries' ) && $entry->user_id === $user->user_id ) + return true; + + return false; + } + +} diff --git a/app/Policies/TempFilePolicy.php b/app/Policies/TempFilePolicy.php new file mode 100644 index 0000000..c1d0433 --- /dev/null +++ b/app/Policies/TempFilePolicy.php @@ -0,0 +1,13 @@ +_can( 'romhackplaza', 'canSubmitTempFile' ); + } +}