Hi all from a Yii newbie!
I’m confused about the AuthManager in general and the schema used for DB tables.
[list=1]
[*]The type field in the AuthItem table can be only between 0 and 2 ( Role=2, Task=1, Operation=0 ) ?
[*]Could you make me an example of what I can find stored in the bizrule and data fields using the blog used in the tutorial ?
[*]The userid field must be a varchar?
[/list]
This schema ( for MySQL ) generates any conflict ?
CREATE TABLE `AuthItem` (
`name` varchar(60) NOT NULL,
`type` tinyint(1) unsigned NOT NULL,
`description` varchar(255),
`bizrule` text,
`data` text,
PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `AuthItemChild` (
`parent` varchar(60) NOT NULL,
`child` varchar(60) NOT NULL,
PRIMARY KEY (`parent`,`child`),
FOREIGN KEY (`parent`) REFERENCES `AuthItem` (`name`)
ON DELETE CASCADE
ON UPDATE CASCADE,
FOREIGN KEY (`child`) REFERENCES `AuthItem` (`name`)
ON DELETE CASCADE
ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `AuthAssignment` (
`itemname` varchar(60) NOT NULL,
`userid` int(10) unsigned NOT NULL,
`bizrule` text,
`data` text,
PRIMARY KEY (`itemname`,`userid`),
FOREIGN KEY (`itemname`) REFERENCES `AuthItem` (`name`)
ON DELETE CASCADE
ON UPDATE CASCADE,
FOREIGN KEY (`userid`) REFERENCES `User` (`userid`)
ON DELETE CASCADE
ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
THANKS IN ADVANCE!