File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
setup/src/Magento/Setup/Fixtures Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ public function execute()
32
32
/** @var \Magento\Authorization\Model\RoleFactory $roleFactory */
33
33
$ roleFactory = $ this ->fixtureModel ->getObjectManager ()->create (\Magento \Authorization \Model \RoleFactory::class);
34
34
35
+ $ defaultAdminUser = $ adminUserFactory ->create ()->loadByUsername ('admin ' );
36
+ $ defaultAdminRole = $ roleFactory ->create ()->load ($ defaultAdminUser ->getAclRole ());
37
+
35
38
for ($ i = 1 ; $ i <= $ adminUsersNumber ; $ i ++) {
36
39
$ adminUser = $ adminUserFactory ->create ();
37
40
$ adminUser
@@ -47,11 +50,11 @@ public function execute()
47
50
$ role
48
51
->setUserId ($ adminUser ->getId ())
49
52
->setRoleName ('admin ' )
50
- ->setRoleType (' U ' )
51
- ->setUserType (2 )
52
- ->setTreeLevel (2 )
53
- ->setSortOrder (0 )
54
- ->setParentId (1 );
53
+ ->setRoleType ($ defaultAdminRole -> getRoleType () )
54
+ ->setUserType ($ defaultAdminRole -> getUserType () )
55
+ ->setTreeLevel ($ defaultAdminRole -> getTreeLevel () )
56
+ ->setSortOrder ($ defaultAdminRole -> getSortOrder () )
57
+ ->setParentId ($ defaultAdminRole -> getParentId () );
55
58
$ role ->save ();
56
59
}
57
60
You can’t perform that action at this time.
0 commit comments