What is the best way to manage permissions for a web application - bitmask or database table?

前端 未结 9 762
感动是毒
感动是毒 2020-12-22 19:06

I\'m considering the best way to design a permissions system for an \"admin\" web application. The application is likely to have many users, each of whom could be assigned a

9条回答
  •  天涯浪人
    2020-12-22 19:33

    I think it's a general rule of thumb to stay away from mystical bitstrings that encode the meaning of the universe.

    While perhaps clunkier, having a table of possible permissions, a table of users, and a link table between them is the best and clearest way to organize this. It also makes your queries and maintenance (especially for the new guy) a lot easier.

提交回复
热议问题