From: Vincent Vanwaelscappel Date: Wed, 4 Mar 2020 19:01:06 +0000 (+0100) Subject: wip #3466 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=bef8e6e0083161e6d370e5c77b37f589b4b3ba9c;p=fluidbook-toolbox.git wip #3466 --- diff --git a/app/Models/Quiz.php b/app/Models/Quiz.php index 283390e0b..1e07b4afe 100644 --- a/app/Models/Quiz.php +++ b/app/Models/Quiz.php @@ -80,7 +80,6 @@ class Quiz extends CubistMagicAbstractModel 'column' => true, 'tab' => 'Contents']); - foreach (self::$_messages as $name => $label) { $this->addField(['name' => $name, 'label' => $label, @@ -98,6 +97,12 @@ class Quiz extends CubistMagicAbstractModel 'tab' => 'Questions / Answers', ]); + $this->addField(['name' => 'owner', + 'label' => 'Owner', + 'type' => 'User', + 'column' => true, + 'tab' => 'Settings']); + $this->addField(['name' => 'scorm', 'label' => 'SCORM enabled', 'type' => 'Checkbox', diff --git a/app/Policies/QuizPolicy.php b/app/Policies/QuizPolicy.php new file mode 100644 index 000000000..b58c26d10 --- /dev/null +++ b/app/Policies/QuizPolicy.php @@ -0,0 +1,97 @@ +hasPermissionTo('viewany')) { + return true; + } + return $user->getKey() === $quiz->owner; + } + + /** + * Determine whether the user can create quizzes. + * + * @param \App\User $user + * @return mixed + */ + public function create(User $user) + { + // + } + + /** + * Determine whether the user can update the quiz. + * + * @param \App\User $user + * @param \App\Quiz $quiz + * @return mixed + */ + public function update(User $user, Quiz $quiz) + { + // + } + + /** + * Determine whether the user can delete the quiz. + * + * @param \App\User $user + * @param \App\Quiz $quiz + * @return mixed + */ + public function delete(User $user, Quiz $quiz) + { + // + } + + /** + * Determine whether the user can restore the quiz. + * + * @param \App\User $user + * @param \App\Quiz $quiz + * @return mixed + */ + public function restore(User $user, Quiz $quiz) + { + // + } + + /** + * Determine whether the user can permanently delete the quiz. + * + * @param \App\User $user + * @param \App\Quiz $quiz + * @return mixed + */ + public function forceDelete(User $user, Quiz $quiz) + { + // + } +} diff --git a/composer.lock b/composer.lock index b651a2554..122ad7465 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f821ecd1f86603733fc92ca110fa90df", + "content-hash": "7f40e4b7c7756bcc6128cbd06a2cef11", "packages": [ { "name": "backpack/backupmanager", @@ -71,16 +71,16 @@ }, { "name": "backpack/crud", - "version": "4.0.43", + "version": "4.0.44", "source": { "type": "git", "url": "https://github.com/Laravel-Backpack/CRUD.git", - "reference": "a42a1bac0c993fb362bbc5f7ebb74516ef99611a" + "reference": "1b76b0a41e7ae0b0e1d9b200cf2a98b64deab1f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Laravel-Backpack/CRUD/zipball/a42a1bac0c993fb362bbc5f7ebb74516ef99611a", - "reference": "a42a1bac0c993fb362bbc5f7ebb74516ef99611a", + "url": "https://api.github.com/repos/Laravel-Backpack/CRUD/zipball/1b76b0a41e7ae0b0e1d9b200cf2a98b64deab1f7", + "reference": "1b76b0a41e7ae0b0e1d9b200cf2a98b64deab1f7", "shasum": "" }, "require": { @@ -153,7 +153,7 @@ "read", "update" ], - "time": "2020-03-04T06:46:54+00:00" + "time": "2020-03-04T15:15:16+00:00" }, { "name": "backpack/logmanager", @@ -919,13 +919,13 @@ "source": { "type": "git", "url": "git://git.cubedesigners.com/cubist_cms-back.git", - "reference": "460bfd45c1b7020e0a986158225c5ec4c9d09401" + "reference": "593264b8a54381a029e99c88f7cdf49b10691a9b" }, "dist": { "type": "tar", - "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-master-76f470.tar", - "reference": "460bfd45c1b7020e0a986158225c5ec4c9d09401", - "shasum": "509d782e101b6a8ffddc7d7e6bb33b0187d1c232" + "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-master-506b1e.tar", + "reference": "593264b8a54381a029e99c88f7cdf49b10691a9b", + "shasum": "328edcd2927af952ab2a1cf219f3ab7ecc727cb6" }, "require": { "backpack/backupmanager": "^2.0", @@ -996,7 +996,7 @@ } ], "description": "Cubist Backpack extension", - "time": "2020-03-03T19:12:14+00:00" + "time": "2020-03-04T18:41:48+00:00" }, { "name": "cubist/cms-front", @@ -4773,16 +4773,16 @@ }, { "name": "spatie/laravel-medialibrary", - "version": "7.19.0", + "version": "7.19.1", "source": { "type": "git", "url": "https://github.com/spatie/laravel-medialibrary.git", - "reference": "a7b75fe3730da8b6e0241629fa4c25c376e7863f" + "reference": "4cbe7c03df14015b6ea17338e642b1125142b86e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-medialibrary/zipball/a7b75fe3730da8b6e0241629fa4c25c376e7863f", - "reference": "a7b75fe3730da8b6e0241629fa4c25c376e7863f", + "url": "https://api.github.com/repos/spatie/laravel-medialibrary/zipball/4cbe7c03df14015b6ea17338e642b1125142b86e", + "reference": "4cbe7c03df14015b6ea17338e642b1125142b86e", "shasum": "" }, "require": { @@ -4855,7 +4855,7 @@ "media", "spatie" ], - "time": "2020-03-03T07:52:30+00:00" + "time": "2020-03-04T17:01:00+00:00" }, { "name": "spatie/laravel-missing-page-redirector", @@ -10125,7 +10125,8 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": ">=7.4" + "php": ">=7.4", + "ext-tidy": "*" }, "platform-dev": [] }