惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
Schneier on Security
Schneier on Security
B
Blog RSS Feed
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
A
About on SuperTechFans
Recorded Future
Recorded Future
Recent Announcements
Recent Announcements
Microsoft Security Blog
Microsoft Security Blog
L
LangChain Blog
Hugging Face - Blog
Hugging Face - Blog
The GitHub Blog
The GitHub Blog
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MyScale Blog
MyScale Blog
V2EX - 技术
V2EX - 技术
N
Netflix TechBlog - Medium
F
Fortinet All Blogs
V
Visual Studio Blog
Martin Fowler
Martin Fowler
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - Franky
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
The Exploit Database - CXSecurity.com
F
Full Disclosure
Scott Helme
Scott Helme
H
Heimdal Security Blog
博客园 - 叶小钗
Google DeepMind News
Google DeepMind News
Cyberwarzone
Cyberwarzone
Application and Cybersecurity Blog
Application and Cybersecurity Blog
V
Vulnerabilities – Threatpost
Blog — PlanetScale
Blog — PlanetScale
Security Latest
Security Latest
WordPress大学
WordPress大学
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Troy Hunt's Blog
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
Jina AI
Jina AI
S
Securelist
小众软件
小众软件
Simon Willison's Weblog
Simon Willison's Weblog
J
Java Code Geeks
AWS News Blog
AWS News Blog
N
News and Events Feed by Topic
博客园 - 三生石上(FineUI控件)
量子位

博客园 - lisugar

BPEL元素定义层次关系 去黑头的方法.... BPEL中的XML元素解析 2 - lisugar - 博客园 BPEL中的XML元素解析 WDSL文件中的XML元素 WS-BPEL2.0 Specification 什么是BPEL - 老外们给的定义 你们猜吧:) 劳动人民的智慧是无穷的,只要你有发现的眼睛 安全 C# .net 2005 beta 所有安装连接 .net中实现拖拽控件 今天最大的收获 C#程序分类管理 C#创建目录的方法 [wenService]ASP.Net+XML打造留言薄 [webService]如何编写需要授权才能使用的WebService?(原著网事如风) [[Advanced T-SQL]] Automate the Generation of Stored Procedures for Your Database [C#]Windows服务程序[转载西门吹雪的好文章]
数据库中权限分配技巧
lisugar · 2005-01-19 · via 博客园 - lisugar

    刚刚看了一篇文章,觉得挺好。也许别人觉得挺简单,可是起码我以前没有用过的,所以转记下来。
    当我们在建数据库的时候,经常要碰到权限分配的问题,为了节省数据库的空间,我们可以用一个数来代表一个人的所有权限,而不用占用许多行来描述同一个人的不同权限。
    这就要用到了一个简单的符号“&”。
    例如:假定权限的编号为1,2,4,... (为了方便我们进行计算)如果某个人的权限为1、4、8,那么我们在数据库中对应该行的位置写入13(1+4+8)。而当我们读取出时,判断该人的权限就要用到“与”操作了,这样要比将该数进行拆分要简单和清楚。用读取出来的值分别与每个权限编号进行与操作,结果大于0的就说明有此权限。13&1>0,13&2=0,13&4>0...
    好了就写到这了,该吃饭了。