Merge "Bypass login page if no user input is required."
[lhc/web/wiklou.git] / resources / src / mediawiki / mediawiki.Upload.BookletLayout.js
index 7c4855f..c7ebfd8 100644 (file)
@@ -1,4 +1,4 @@
-/*global moment*/
+/* global moment*/
 ( function ( $, mw, moment ) {
 
        /**
                                        // If the user can't upload anything, don't give them the option to.
                                        api.getUserInfo().then( function ( userInfo ) {
                                                if ( userInfo.rights.indexOf( 'upload' ) === -1 ) {
-                                                       // TODO Use a better error message when not all logged-in users can upload
-                                                       booklet.getPage( 'upload' ).$element.msg( 'api-error-mustbeloggedin' );
+                                                       if ( mw.user.isAnon() ) {
+                                                               booklet.getPage( 'upload' ).$element.msg( 'api-error-mustbeloggedin' );
+                                                       } else {
+                                                               booklet.getPage( 'upload' ).$element.msg( 'api-error-badaccess-groups' );
+                                                       }
                                                }
                                                return $.Deferred().resolve();
                                        } )