Remove usages of Title::quickUserCan
[lhc/web/wiklou.git] / includes / Permissions / PermissionManager.php
index f9ad3eb..37791d0 100644 (file)
@@ -231,6 +231,25 @@ class PermissionManager {
                return !count( $this->getPermissionErrorsInternal( $action, $user, $page, $rigor, true ) );
        }
 
+       /**
+        * A convenience method for calling PermissionManager::userCan
+        * with PermissionManager::RIGOR_QUICK
+        *
+        * Suitable for use for nonessential UI controls in common cases, but
+        * _not_ for functional access control.
+        * May provide false positives, but should never provide a false negative.
+        *
+        * @see PermissionManager::userCan()
+        *
+        * @param string $action
+        * @param User $user
+        * @param LinkTarget $page
+        * @return bool
+        */
+       public function quickUserCan( $action, User $user, LinkTarget $page ) {
+               return $this->userCan( $action, $user, $page, self::RIGOR_QUICK );
+       }
+
        /**
         * Can $user perform $action on a page?
         *