PHP-Code:
#
# The structure for table `groupPermissions`
#
DROP TABLE IF EXISTS `groupPermissions`;
CREATE TABLE `groupPermissions`
(
`groupId` TINYINT UNSIGNED NOT NULL,
`moduleId` SMALLINT UNSIGNED NOT NULL,
`rights` CHAR (3) NOT NULL,
FOREIGN KEY (`groupId`) REFERENCES userGroups(`groupId`)
) TYPE=MyISAM;
#
# The structure for table `userGroups`
#
DROP TABLE IF EXISTS `userGroups`;
CREATE TABLE `userGroups`
(
`groupId` TINYINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
`name` VARCHAR(100) NOT NULL DEFAULT ''
) TYPE=MyISAM;
#
# The structure for table `users`
#
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users`
(
`userId` SMALLINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
`username` CHAR(30) NOT NULL DEFAULT '',
`password` CHAR(32) NOT NULL DEFAULT '',
`name` CHAR(30) NOT NULL DEFAULT '',
`surname` CHAR(40) NOT NULL DEFAULT '',
`email` VARCHAR(100) NOT NULL DEFAULT '',
`registerDate` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`lastVisit` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`block` BOOLEAN DEFAULT '0',
`userGroup` TINYINT(4) NOT NULL DEFAULT '1',
FOREIGN KEY (`userGroup`) REFERENCES userGroups(`groupId`)
)TYPE=MyISAM;
groupPermissions.rights kann folgende Werte haben.
ned // new edit delete
ed // edit delete
...
Lesezeichen