Skip to content

Instantly share code, notes, and snippets.

@gautamk
Created February 3, 2012 14:48
Show Gist options
  • Save gautamk/1730506 to your computer and use it in GitHub Desktop.
Save gautamk/1730506 to your computer and use it in GitHub Desktop.
CREATE TABLE `user_resources` (
`id` INT NOT NULL AUTO_INCREMENT
, `name` VARCHAR(255)
, `description` VARCHAR(255)
, `parentId` INT DEFAULT NULL
, PRIMARY KEY (`id`)
);
CREATE TABLE `user_roles` (
`id` INT NOT NULL AUTO_INCREMENT
, `name` VARCHAR(255) NOT NULL
, `description` VARCHAR(255)
, `parentId` INT DEFAULT NULL
, PRIMARY KEY (`id`)
);
CREATE TABLE `user_permissions` (
`id` INT NOT NULL AUTO_INCREMENT
, `role` INT
, `resource` INT
, `read` BOOLEAN DEFAULT FALSE
, `write` BOOLEAN DEFAULT FALSE
, `modify` BOOLEAN DEFAULT FALSE
, `delete` BOOLEAN DEFAULT FALSE
, `publish` BOOLEAN DEFAULT FALSE
, `description` VARCHAR(255)
, PRIMARY KEY (`id`)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment