40 $this->_cache =
$cache->getFrontend();
50 $this->
_init(
'authorization_role',
'role_id');
51 $this->_ruleTable = $this->
getTable(
'authorization_rule');
62 if ($role->getId() ==
'') {
63 if ($role->getIdFieldName()) {
64 $role->unsetData($role->getIdFieldName());
66 $role->unsetData(
'id');
70 if (!$role->getTreeLevel()) {
72 if ($role->getPid() > 0) {
77 "{$this->getIdFieldName()} = :pid" 80 $binds = [
'pid' => (int)$role->getPid()];
85 $role->setTreeLevel($treeLevel + 1);
88 if ($role->getName()) {
89 $role->setRoleName($role->getName());
120 $connection->delete($this->_ruleTable, [
'role_id = ?' => (
int)$role->getId()]);
135 $binds = [
'role_id' => $role->getId(),
'role_type' => RoleUser::ROLE_TYPE];
139 ->where(
'parent_id = :role_id')
140 ->where(
'role_type = :role_type')
141 ->where(
'user_id > 0');
getRoleUsers(\Magento\Authorization\Model\Role $role)
_init($mainTable, $idFieldName)
_afterSave(\Magento\Framework\Model\AbstractModel $role)
_beforeSave(\Magento\Framework\Model\AbstractModel $role)
const CLEANING_MODE_MATCHING_TAG
__construct(\Magento\Framework\Model\ResourceModel\Db\Context $context, \Magento\Framework\App\CacheInterface $cache, $connectionName=null)
_afterDelete(\Magento\Framework\Model\AbstractModel $role)