Skip to content
Permalink
Browse files

better error message when trying to generate a migration for the crea…

…tion of a Role fails
  • Loading branch information...
gggeek committed Nov 11, 2017
1 parent 91c2e2c commit a9c4cbbaef5c3367287a6ad31519307dd2bea337
Showing with 11 additions and 1 deletion.
  1. +5 −1 Core/Executor/RepositoryExecutor.php
  2. +3 −0 Core/Executor/RoleManager.php
  3. +3 −0 WHATSNEW.md
@@ -135,13 +135,17 @@ protected function getUserContentType($step)
return isset($step->dsl['user_content_type']) ? $step->dsl['user_content_type'] : $this->getUserContentTypeFromContext($step->context);
}
/**
* @param array $context
* @return string
*/
protected function getUserContentTypeFromContext($context)
{
return isset($context['userContentType']) ? $context['userContentType'] : self::USER_CONTENT_TYPE;
}
/**
* @param $context we have to return FALSE if that is set as adminUserLogin, whereas if NULL is set, we return the default admin
* @param array $context we have to return FALSE if that is set as adminUserLogin, whereas if NULL is set, we return the default admin
* @return int|string|false
*/
protected function getAdminUserIdentifierFromContext($context)
@@ -246,6 +246,9 @@ public function generateMigration(array $matchCondition, $mode, array $context =
$limitations = array();
foreach ($policy->getLimitations() as $limitation) {
if ($limitation === null) {
throw new \Exception("The role contains NULL as limitation for policy {$policy->module}/{$policy->function}, we can not reliably generate its definition.");
}
$limitations[] = $this->limitationConverter->getLimitationArrayWithIdentifiers($limitation);
}
@@ -13,6 +13,9 @@ Version 4.4 (unreleased)
* New: support the value '*' for the `remove_attributes` parameter in ContentType definitions. This allows to remove all
the attributes which already exist in the ContentType, except for the ones defined in the `attributes` parameter
* Improved: better error message when trying to generate a migration for the creation of a Role which has Policies with
limitations that can not be exported
Version 4.3
===========

0 comments on commit a9c4cbb

Please sign in to comment.
You can’t perform that action at this time.