| @@ 64-68 (lines=5) @@ | ||
| 61 | if (isset($this->dsl['roles'])) { |
|
| 62 | $roleService = $this->repository->getRoleService(); |
|
| 63 | // we support both Ids and Identifiers |
|
| 64 | foreach ($this->dsl['roles'] as $roleId) { |
|
| 65 | $roleId = $this->referenceResolver->resolveReference($roleId); |
|
| 66 | $role = $this->roleMatcher->matchOneByKey($roleId); |
|
| 67 | $roleService->assignRoleToUserGroup($role, $userGroup); |
|
| 68 | } |
|
| 69 | } |
|
| 70 | ||
| 71 | $this->setReferences($userGroup); |
|
| @@ 45-53 (lines=9) @@ | ||
| 42 | $contentTypeService = $this->repository->getContentTypeService(); |
|
| 43 | ||
| 44 | $userGroups = array(); |
|
| 45 | foreach ($this->dsl['groups'] as $groupId) { |
|
| 46 | $groupId = $this->referenceResolver->resolveReference($groupId); |
|
| 47 | $userGroup = $this->userGroupMatcher->matchOneByKey($groupId); |
|
| 48 | ||
| 49 | // q: in which case can we have no group? And should we throw an exception? |
|
| 50 | //if ($userGroup) { |
|
| 51 | $userGroups[] = $userGroup; |
|
| 52 | //} |
|
| 53 | } |
|
| 54 | ||
| 55 | // FIXME: Hard coding content type to user for now |
|
| 56 | $userContentType = $contentTypeService->loadContentTypeByIdentifier(self::USER_CONTENT_TYPE); |
|