具有用户,角色和权限的数据库模型
我有一个带有用户表和角色表的数据库模型。我想控制对多达10个不同元素的访问(权限)。可以将访问权限授予角色或单个用户。以下是用户,角色和项目的表定义: CREATE TABLE users ( id serial NOT NULL PRIMARY KEY, username character varying UNIQUE, password character varying, first_name character varying, last_name character varying, ... ); CREATE TABLE roles ( id serial NOT NULL PRIMARY KEY, name character varying NOT NULL, description character varying, ... ); CREATE TABLE element_1 ( …