Out permission errors, control [field authority] [Cell permission] data in the table, is actually very simple sent to you pierce that layer of paper (free into the master) ...

Read the article to blog Park is not all are masters, there are some beginners, this article is mainly for beginners, not deep contact with permissions to provide a reference.

We used to have a few buttons on the page, these buttons control authority, are doing very skilled
for example btnAdd the Add button, btnEdit Edit button, btnDelete delete button, this
page is the basic student information management page frmStudentManager.

Then we can set these permissions correspond relationship:
"addStudent" permission correspondence -> Available Properties "frmStudentManager.btnAdd" button
"EditStudent" permission correspondence -> Available Properties "frmStudentManager.btnEdit" button
"DeleteStudent" permission correspondence -> "frmStudentManager .btnDelete "button available properties of
this we have a good understanding.

 

If students have RealName this table Name, Code number, Age Age, Sex sex and other fields,
users can access those columns also need access control, all easily confused, is actually very simple
truth, but we did not want to complete the same nature of the problem only, in fact,

we can set these permissions correspond relationship:
"ViewStudentRealName" the proper permission -> list "RealName name field is visible"
"ViewStudentCode" permission correspondence -> list "Code number field is visible"
"ViewStudentAge" permission correspondence -> list "Age age field is visible"
"ViewStudentSex" permission correspondence -> list "sex gender field is visible"

just a few more rights, some rights are the corresponding button of the available properties, some of the corresponding column visible property only.

Cell control authority, the same principle is over, can draw inferences, but there is a corresponding permissions corresponding to each cell unique on it.

In fact, the difficulty is not difficult, and sent it to pierce that layer of paper, the basic principle is the same, but changed the expression of it.
Often encountered in the past few years, such a question, a good mood today to write articles for your reference reference to it in the future may come in handy.

As for all the tables in the database automatically controls all fields, etc., that is another problem areas,
more than just the core idea of solving the problem, you work a little bit, you can get,
and even control of the data source, altogether no authority tonal data is not read out, it is also possible according to the above ideas to solve, it depends on your own reality.

 

Reproduced in: https: //my.oschina.net/iwenr/blog/227561

Guess you like

Origin blog.csdn.net/weixin_33853794/article/details/91675153