+ /**
+ * Check if a log item type can be displayed
+ * @return bool
+ */
+ public function canViewLogType() {
+ // If the user doesn't have the right permission to view the specific
+ // log type, return false
+ $logRestrictions = $this->context->getConfig()->get( 'LogRestrictions' );
+ $type = $this->entry->getType();
+ return !isset( $logRestrictions[$type] )
+ || MediaWikiServices::getInstance()
+ ->getPermissionManager()
+ ->userHasRight( $this->context->getUser(), $logRestrictions[$type] );
+ }
+