-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
application and school configuration #1736
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional stuff:
-
Add configurations to the tests at https://github.com/ilios/ilios/blob/master/tests/CoreBundle/Entity/SchoolTest.php#L41
-
Needs an API version bump in https://github.com/ilios/ilios/blob/master/src/Ilios/WebBundle/Service/WebIndexFromJson.php#L14
case self::DELETE: | ||
// grant CREATE, EDIT and DELETE privileges | ||
// if the user has the 'Developer' role | ||
return $this->userHasRole($user, ['Developer']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should they also be in the school? Along with being a developer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is correct as-is, following the same pattern as vocabularies. unless you want to enforce more narrow/school-scoped permissions on the frontend as well.
throw $this->createAccessDeniedException('Unauthorized access!'); | ||
} | ||
|
||
$answer['application_configs'][] = $applicationConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't underscore anywhere else. Also it makes ember-data sad and we have to write custom adapters. Can we use applicationConfigs
here?
}); | ||
|
||
//If there are no matches return an empty array | ||
$answer['application_configs'] = $result ? array_values($result) : []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use applicationConfigs
here?
$manager = $this->container->get('ilioscore.applicationconfig.manager'); | ||
$manager->update($applicationConfig, true, false); | ||
|
||
$answer['application_configs'] = [$applicationConfig]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use applicationConfigs
here?
* | ||
* @return Response | ||
*/ | ||
public function getAction($id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use DTOs instead of entities. We're going that way with all of the old stuff and it would be good not to have to circle back and fix new ones as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be handled as follow-up item, see #1743.
*/ | ||
public function getAction($id) | ||
{ | ||
$schoolConfig = $this->getOr404($id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use the DTO pattern here. It is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will need to be addressed later, see #1743.
throw $this->createAccessDeniedException('Unauthorized access!'); | ||
} | ||
|
||
$answer['school_configs'][] = $schoolConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use schoolConfigs
here?
}); | ||
|
||
//If there are no matches return an empty array | ||
$answer['school_configs'] = $result ? array_values($result) : []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use schoolConfigs
here?
$manager = $this->container->get('ilioscore.schoolconfig.manager'); | ||
$manager->update($schoolConfig, true, false); | ||
|
||
$answer['school_configs'] = [$schoolConfig]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use schoolConfigs
here?
|
||
$manager->update($schoolConfig, true, true); | ||
|
||
$answer['school_config'] = $schoolConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use schoolConfigs
here?
@jrjohnson ready to be reviewed again. |
fixes #1735