I create an admin user role from setup using this code,




But I want to add a new resource to this role, using UpgradeData.

Is there any solution?

1 Answer 1


I do it, using this code :

$role = $this->_roleCollection->addFieldToFilter('role_name', 'test')->getFirstItem();
$resource = $this->_aclRetriver->getAllowedResourcesByRole($role->getId());

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.