]> _ Git - cubist_cms-back.git/commitdiff
wip #4795 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 18 Oct 2021 16:54:15 +0000 (18:54 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 18 Oct 2021 16:54:15 +0000 (18:54 +0200)
src/app/Magic/Models/CubistMagicAbstractModel.php

index 5f0e397d39e4674731e9ab21858ad99509bf0340..881ff268bbf81d36212ddc39ce1348eb063148e5 100644 (file)
@@ -843,14 +843,15 @@ class CubistMagicAbstractModel extends Model implements HasMedia
         if (null === $user) {
             return false;
         }
-        $permission = $this->getOption('name') . ':' . $operation;
+        $permission = $this->getOption('permissions', $this->getOption('name')) . ':' . $operation;
         return $user->can($permission);
     }
 
-    /**
-     * @param $user CubistMagicAuthenticatable
-     * @return bool
-     */
+
+        /**
+         * @param $user CubistMagicAuthenticatable
+         * @return bool
+         */
     public function canView($user)
     {
         return $this->canList($user);