Problem: Getting 403 you are not authorized error when trying to access: mydomain.com/index.php?r=rights
I have downloaded the rights module and following the yii-rights-doc-1.2.0 installation instructions.
Prior to installing rights, I have created some Rbac table structures and populated with some roles and permissions. (for reference, the sql create data included below)
My rights config is as follows: (a bit puzzled as to why 'installed' appears twice in this array?):
As you can see, my main super user role below is 'chadmin' ... which is an item in my AuthItem table
--
-- Table structure for table `AuthAssignment`
--
CREATE TABLE IF NOT EXISTS `AuthAssignment` (
`itemname` varchar(64) NOT NULL,
`userid` varchar(64) NOT NULL,
`bizrule` text,
`data` text,
PRIMARY KEY (`itemname`,`userid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `AuthAssignment`
--
INSERT INTO `AuthAssignment` (`itemname`, `userid`, `bizrule`, `data`) VALUES
('assetdstr', '12', NULL, 'N;'),
('assetdstr', '13', NULL, 'N;'),
('assetdstr', '4', NULL, 'N;'),
('assetdstr', '5', NULL, 'N;'),
('assetmgr', '2', NULL, 'N;'),
('assetmgr', '3', NULL, 'N;'),
('benefactor', '6', NULL, 'N;'),
('chadmin', '1', NULL, 'N;'),
('staff', '10', NULL, 'N;'),
('staff', '11', NULL, 'N;'),
('staff', '7', NULL, 'N;'),
('staff', '8', NULL, 'N;'),
('staff', '9', NULL, 'N;');
-- --------------------------------------------------------
--
-- Table structure for table `AuthItem`
--
CREATE TABLE IF NOT EXISTS `AuthItem` (
`name` varchar(64) NOT NULL,
`type` int(11) NOT NULL,
`description` text,
`bizrule` text,
`data` text,
PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `AuthItem`
--
INSERT INTO `AuthItem` (`name`, `type`, `description`, `bizrule`, `data`) VALUES
('assetdstr', 2, 'Asset Distributor', NULL, 'N;'),
('assetmgr', 2, 'Asset Manager', NULL, 'N;'),
('benefactor', 2, 'Benefactor', NULL, 'N;'),
('chadmin', 2, 'CHAMS Admin', NULL, 'N;'),
('createAsset', 0, 'create a new asset', NULL, 'N;'),
('createAssetBusinessUnitAssignment', 0, 'create a new asset-bu assignment', NULL, 'N;'),
('createAssetUserAssignment', 0, 'create a new asset-user assignment', NULL, 'N;'),
('createBusinessUnit', 0, 'create a new business unit', NULL, 'N;'),
('createUser', 0, 'create a new user', NULL, 'N;'),
('createUserBusinessUnitAssignment', 0, 'create a new user-business_unit assignment', NULL, 'N;'),
('deleteAsset', 0, 'delete an asset', NULL, 'N;'),
('deleteAssetBusinessUnitAssignment', 0, 'delete a asset-bu assignment', NULL, 'N;'),
('deleteAssetUserAssignment', 0, 'delete a asset-user assignment', NULL, 'N;'),
('deleteBusinessUnit', 0, 'delete a business unit', NULL, 'N;'),
('deleteUser', 0, 'remove a user', NULL, 'N;'),
('deleteUserBusinessUnitAssignment', 0, 'delete a user-business_unit assignment', NULL, 'N;'),
('readAsset', 0, 'read asset information', NULL, 'N;'),
('readAssetBusinessUnitAssignment', 0, 'read a asset-bu assignment', NULL, 'N;'),
('readAssetUserAssignment', 0, 'read a user-asset-user assignment', NULL, 'N;'),
('readBusinessUnit', 0, 'read business unit information', NULL, 'N;'),
('readUser', 0, 'read user profile information', NULL, 'N;'),
('readUserBusinessUnitAssignment', 0, 'read a user-business_unit assignment', NULL, 'N;'),
('staff', 2, 'Staff', NULL, 'N;'),
('updateAsset', 0, 'update asset information', NULL, 'N;'),
('updateAssetBusinessUnitAssignment', 0, 'update a asset-bu assignment', NULL, 'N;'),
('updateAssetUserAssignment', 0, 'update a asset-user assignment', NULL, 'N;'),
('updateBusinessUnit', 0, 'update business unit information', NULL, 'N;'),
('updateUser', 0, 'update a user''s information', NULL, 'N;'),
('updateUserBusinessUnitAssignment', 0, 'update a user-business_unit assignment', NULL, 'N;');
-- --------------------------------------------------------
--
-- Table structure for table `AuthItemChild`
--
CREATE TABLE IF NOT EXISTS `AuthItemChild` (
`parent` varchar(64) NOT NULL,
`child` varchar(64) NOT NULL,
PRIMARY KEY (`parent`,`child`),
KEY `child` (`child`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `AuthItemChild`
--
INSERT INTO `AuthItemChild` (`parent`, `child`) VALUES
('assetmgr', 'assetdstr'),
('chadmin', 'assetmgr'),
('staff', 'benefactor'),
('assetmgr', 'createAsset'),
('assetmgr', 'createAssetBusinessUnitAssignment'),
('assetdstr', 'createAssetUserAssignment'),
('assetmgr', 'createBusinessUnit'),
('chadmin', 'createUser'),
('chadmin', 'createUserBusinessUnitAssignment'),
('assetmgr', 'deleteAsset'),
('assetmgr', 'deleteAssetBusinessUnitAssignment'),
('assetdstr', 'deleteAssetUserAssignment'),
('assetmgr', 'deleteBusinessUnit'),
('chadmin', 'deleteUser'),
('chadmin', 'deleteUserBusinessUnitAssignment'),
('assetdstr', 'readAsset'),
('assetmgr', 'readAsset'),
('staff', 'readAsset'),
('assetmgr', 'readAssetBusinessUnitAssignment'),
('assetdstr', 'readAssetUserAssignment'),
('assetmgr', 'readBusinessUnit'),
('assetmgr', 'readUser'),
('chadmin', 'readUser'),
('chadmin', 'readUserBusinessUnitAssignment'),
('assetdstr', 'staff'),
('assetmgr', 'updateAsset'),
('assetmgr', 'updateAssetBusinessUnitAssignment'),
('assetdstr', 'updateAssetUserAssignment'),
('assetmgr', 'updateBusinessUnit'),
('chadmin', 'updateUser'),
('chadmin', 'updateUserBusinessUnitAssignment');
--
-- Constraints for dumped tables
--
--
-- Constraints for table `AuthAssignment`
--
ALTER TABLE `AuthAssignment`
ADD CONSTRAINT `AuthAssignment_ibfk_1` FOREIGN KEY (`itemname`) REFERENCES `AuthItem` (`name`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `AuthItemChild`
--
ALTER TABLE `AuthItemChild`
ADD CONSTRAINT `AuthItemChild_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `AuthItem` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `AuthItemChild_ibfk_2` FOREIGN KEY (`child`) REFERENCES `AuthItem` (`name`) ON DELETE CASCADE ON UPDATE CASCADE;
Any help on how to solve this / even where to start looking would be greatly appreciated.