Home > Back-end >  Small white soon just contact a visible level of permissions, please, help me
Small white soon just contact a visible level of permissions, please, help me

Time:11-30

A total of 4 tables are respectively (project table, users table, file sharing among tables and table), among the three tables are linked to the table, the table in the middle of the field has, user id, item id, and position
The midterm project list with project managers, project leaders, project leader, members and four post
Share files, I uploaded file action of people, and a team name drop-down box to bind the file below, according to select the project that you upload this file is in this project, there is a visible level of state, 0 is the team, 1 is visible,
I the problem now is the relationship between tables, and how to realize the background code, the background of the problem is that the level of visible, if A user upload A file set up project team to see the user login first to see if he is not belong to the project team B, belongs to the display, do not belong to does not display, and project managers and project leaders can to delete and download my file, he can also upload their own documents, other members can only download and upload your own file, the file on the heir own all permissions, oneself is visible is to see whether the current user file operations,
Beginners small white, please help, thank you thank you thank you a total of 4 tables are respectively (project table, users table, file sharing among tables and table), among the three tables are linked to the table, the table in the middle of the field has, user id, item id, and position
The midterm project list with project managers, project leaders, project leader, members and four post
Share files, I uploaded file action of people, and a team name drop-down box to bind the file below, according to select the project that you upload this file is in this project, there is a visible level of state, 0 is the team, 1 is visible,
I the problem now is the relationship between tables, and how to realize the background code, the background of the problem is that the level of visible, if A user upload A file set up project team to see the user login first to see if he is not belong to the project team B, belongs to the display, do not belong to does not display, and project managers and project leaders can to delete and download my file, he can also upload their own documents, other members can only download and upload your own file, the file on the heir own all permissions, oneself is visible is to see whether the current user file operations,
Beginners small white, please help, thank you thank you thank you

CodePudding user response:

Feel it is not difficult to ah, add a project to the Shared file list id a SQL can fix
 
Select * from the Shared file table A where clause (a. project id in (
Among the select b. project id from table B where user id=?
)
And a. level of visible=0) or a. user id!=?

Background code also CRUD, are you clear about the demand, and nothing is strong logic

CodePudding user response:

reference 1st floor timesong wind xiao xi response:
feel easy ah, add a project to the Shared file list id a SQL can fix
 
Select * from the Shared file table A where clause (a. project id in (
Among the select b. project id from table B where user id=?
)
And a. level of visible=0) or a. user id!=?

Background code also CRUD, are you clear about the requirements and do not have what strong logic

My another post is picture type than it is now the clear, ask for help. Thanks
  • Related