When is it better to store flags as a bitmask rather than using an associative table?

后端 未结 9 1046
滥情空心
滥情空心 2020-12-02 09:31

I’m working on an application where users have different permissions to use different features (e.g. Read, Create, Download, Print, Approve, etc.). The list of permissions i

9条回答
  •  执笔经年
    2020-12-02 10:05

    Store the permissions normalized (i.e. not in a bitmask). While it's obviously not a requirement for your scenario (especially if the permissions won't often change), it will make querying much easier and more obvious.

提交回复
热议问题