Storing application permissions in a database

后端 未结 5 1574
一生所求
一生所求 2021-01-30 18:38

I\'m developing an application for our company that eventually will have lots of ways of restricting users to particular sections/modules. While the application is still small,

5条回答
  •  深忆病人
    2021-01-30 19:28

    Like Ibrahim says, create a new table specifically for your permissions. Assign a numerical value to a user which represents their permission level, say 1 = read, 2= write/read, 3 = modify/write/read. Then in your code, check for proper permission level before allowing a user to perform a specific task. If they don't have the required value (3 to modify or >=2 to write) then you block that ability.

提交回复
热议问题