Skip to content
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

Merged
merged 34 commits into from
Feb 8, 2017
Merged

application and school configuration #1736

merged 34 commits into from
Feb 8, 2017

Conversation

stopfstedt
Copy link
Member

@stopfstedt stopfstedt commented Feb 2, 2017

fixes #1735

selection_134

selection_138

Copy link
Member

@jrjohnson jrjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

case self::DELETE:
// grant CREATE, EDIT and DELETE privileges
// if the user has the 'Developer' role
return $this->userHasRole($user, ['Developer']);
Copy link
Member

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.

Copy link
Member Author

@stopfstedt stopfstedt Feb 7, 2017

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;
Copy link
Member

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) : [];
Copy link
Member

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];
Copy link
Member

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)
Copy link
Member

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.

Copy link
Member Author

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);
Copy link
Member

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.

Copy link
Member Author

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;
Copy link
Member

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) : [];
Copy link
Member

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];
Copy link
Member

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;
Copy link
Member

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?

@stopfstedt
Copy link
Member Author

@jrjohnson ready to be reviewed again.

@jrjohnson jrjohnson merged commit e6f3596 into ilios:master Feb 8, 2017
@stopfstedt stopfstedt deleted the 1735_config branch December 4, 2017 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add application and school configuration to schema
2 participants