-
Notifications
You must be signed in to change notification settings - Fork 183
Open
Labels
CleanupPR or issue introducing/requiring at least one clean-up operationPR or issue introducing/requiring at least one clean-up operationModule: statisticsPR or issue related to statistics modulePR or issue related to statistics moduleProposalPR or issue suggesting an improvement that can be accepted, rejected or alteredPR or issue suggesting an improvement that can be accepted, rejected or altered
Description
master branch
Review the suggested change and remove the below TODO/FIXME comments.
modules/statistics/php/statistics_dd_site.class.inc:_hasAccess()
// TODO: Create a permission specific to statistics
$hasAccessToAllProfiles = $user->hasAllPermissions(
array(
'access_all_profiles',
'data_entry',
)
);
$hasCenterPermission = false;
// TODO: There are no means of set permissions per site for a given user right now: (e.g.)
// The user X can have the permission data_entry on site Y but not on site Z.
// Currently, hasCenterPermission() function checks if the user has a given center AND given
// permission, not if it has permission for this specific center. This logic will be implemented in
// hasCenterPermission() in near versions when the permission framework will allow it.
// If a CenterID is passed in the request, check if the user has the
// data_entry permission at the site/center specified by CenterID.
if (!empty($_REQUEST['CenterID'])) {
$hasCenterPermission = $user->hasCenterPermission(
'data_entry',
intval($_REQUEST['CenterID'])
);
} else {
// FIXME: For the short term the user we'll be granted access
// if at least have permission AND one of the centers
foreach ($user->getCenterIDs() as $centerID) {
if ($user->hasCenterPermission('data_entry', intval($centerID))) {
$hasCenterPermission = true;
break;
}
}
}
See #5687 for more details
Metadata
Metadata
Assignees
Labels
CleanupPR or issue introducing/requiring at least one clean-up operationPR or issue introducing/requiring at least one clean-up operationModule: statisticsPR or issue related to statistics modulePR or issue related to statistics moduleProposalPR or issue suggesting an improvement that can be accepted, rejected or alteredPR or issue suggesting an improvement that can be accepted, rejected or altered