Extjs permission problems require that the controlled objects be menus, buttons, URLs

Source: Internet
Author: User
In the past two days, extjs permissions are resolved. Require control of the object is menu, button, URL solution ideas 1: https://www.php1.cn/wiki/197.html "target =" _ blank "> heavy Connection class
Because the interaction between extjs and the server is in json format, the server does not control the page Jump, page Jump, and the prompt function is completed by extjs.
The interaction methods between extjs and server are all inherited from Ext. data. Connection. This class can intercept all the interaction methods with the server.
If acegi is not verified, 403.jspis will be returned. login. jsp will be returned if you need to log on again.
Therefore, reload the Connection class and rewrite the handleResponse method to determine whether the returned result is 403.jsp, login. jsp. If yes, control the returned result accordingly. If yes, continue to execute the data normally.
I personally added the annotation code in the first line of 403.jsp and login. jsp. This keyword is used to work.

The Code is as follows:

// The Cunnection method is reloaded here to intercept the interaction between the client and the Server. // After the backend acegi intercepts the user request, if there is no permission, 403.jspis is returned. If no logon is performed, login is returned. jsp; // The Json result Ext. override (Ext. data. connection, {handleResponse: Ext. data. connection. prototype. handleResponse. createInterceptor (function (response) {var resText = response. responseText; if (resText. length> 10) {resText = resText. substr (0, 9);} if (resText ='
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.