This repository has been archived by the owner on May 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'hotfix/zend-db-role-provider-sync-miles8of9'
- Loading branch information
Showing
17 changed files
with
163 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
CREATE TABLE IF NOT EXISTS `user_role` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`roleId` varchar(255) NOT NULL, | ||
`is_default` tinyint(1) NOT NULL, | ||
`parent_id` int(11) DEFAULT NULL, | ||
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
CREATE TABLE IF NOT EXISTS `user_role` ( | ||
`id` INT(11) NOT NULL AUTO_INCREMENT, | ||
`role_id` VARCHAR(255) NOT NULL, | ||
`is_default` TINYINT(1) NOT NULL DEFAULT 0, | ||
`parent_id` INT(11) NULL, | ||
PRIMARY KEY (`id`), | ||
UNIQUE INDEX `unique_role` (`role_id` ASC), | ||
INDEX `idx_parent_id` (`parent_id` ASC), | ||
CONSTRAINT `fk_parent_id` FOREIGN KEY (`parent_id`) REFERENCES `user_role` (`id`) ON DELETE SET NULL | ||
) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8 COLLATE = utf8_unicode_ci; | ||
|
||
CREATE TABLE IF NOT EXISTS `user_role_linker` ( | ||
`user_id` int(11) unsigned NOT NULL, | ||
`role_id` int(11) NOT NULL, | ||
PRIMARY KEY (`user_id`,`role_id`), | ||
KEY `role_id` (`role_id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
CREATE TABLE IF NOT EXISTS `user_role_linker` ( | ||
`user_id` INT UNSIGNED NOT NULL, | ||
`role_id` INT(11) NOT NULL, | ||
PRIMARY KEY (`user_id`, `role_id`), | ||
INDEX `idx_role_id` (`role_id` ASC), | ||
INDEX `idx_user_id` (`user_id` ASC), | ||
CONSTRAINT `fk_role_id` FOREIGN KEY (`role_id`) REFERENCES `user_role` (`id`) ON DELETE CASCADE, | ||
CONSTRAINT `fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) ON DELETE CASCADE | ||
) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8 COLLATE = utf8_unicode_ci; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* BjyAuthorize Module (https://github.com/bjyoungblood/BjyAuthorize) | ||
* | ||
* @link https://github.com/bjyoungblood/BjyAuthorize for the canonical source repository | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
|
||
namespace BjyAuthorize\Service; | ||
|
||
use Zend\ServiceManager\FactoryInterface; | ||
use Zend\ServiceManager\ServiceLocatorInterface; | ||
use Zend\Db\TableGateway\TableGateway; | ||
|
||
/** | ||
* @author Simone Castellaneta <[email protected]> | ||
* | ||
* @return \Zend\Db\TableGateway\TableGateway | ||
*/ | ||
class UserRoleServiceFactory implements FactoryInterface | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* @return \Zend\Db\TableGateway\TableGateway | ||
*/ | ||
public function createService(ServiceLocatorInterface $serviceLocator) | ||
{ | ||
return new TableGateway('user_role', $serviceLocator->get('bjyauthorize_zend_db_adapter')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.