mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-29 18:52:22 +01:00
[bug] unauthorized user can see the edit project form
This commit is contained in:
parent
1cc1bd23b7
commit
9e1e23f268
@ -21,6 +21,7 @@
|
|||||||
- Fix a bug: public calendar won't show anything if the current date range include a reserved space availability (#151)
|
- Fix a bug: public calendar won't show anything if the current date range include a reserved space availability (#151)
|
||||||
- Fix a bug: invoices list is not shown by default in "manage invoices" section
|
- Fix a bug: invoices list is not shown by default in "manage invoices" section
|
||||||
- Fix a bug: unable to run rake fablab:es:* tasks due to an issue with gem faraday 0.16.x (was updated to 0.17)
|
- Fix a bug: unable to run rake fablab:es:* tasks due to an issue with gem faraday 0.16.x (was updated to 0.17)
|
||||||
|
- Fix a bug: unauthorized user can see the edit project form
|
||||||
- Fix a security issue: fixed [CVE-2015-9284](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-9284)
|
- Fix a security issue: fixed [CVE-2015-9284](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-9284)
|
||||||
- [TODO DEPLOY] **IMPORTANT** Please read [postgres_upgrade.md](doc/postgres_upgrade.md) for instructions on upgrading PostgreSQL.
|
- [TODO DEPLOY] **IMPORTANT** Please read [postgres_upgrade.md](doc/postgres_upgrade.md) for instructions on upgrading PostgreSQL.
|
||||||
- [TODO DEPLOY] `rake db:migrate`
|
- [TODO DEPLOY] `rake db:migrate`
|
||||||
|
@ -442,9 +442,9 @@ Application.Controllers.controller('NewProjectController', ['$scope', '$state',
|
|||||||
/**
|
/**
|
||||||
* Controller used in the project edition page
|
* Controller used in the project edition page
|
||||||
*/
|
*/
|
||||||
Application.Controllers.controller('EditProjectController', ['$scope', '$state', '$stateParams', 'Project', 'Machine', 'Member', 'Component', 'Theme', 'Licence', '$document', 'CSRF', 'projectPromise', 'Diacritics', 'dialogs', 'allowedExtensions', '_t',
|
Application.Controllers.controller('EditProjectController', ['$rootScope', '$scope', '$state', '$stateParams', 'Project', 'Machine', 'Member', 'Component', 'Theme', 'Licence', '$document', 'CSRF', 'projectPromise', 'Diacritics', 'dialogs', 'allowedExtensions', '_t',
|
||||||
function ($scope, $state, $stateParams, Project, Machine, Member, Component, Theme, Licence, $document, CSRF, projectPromise, Diacritics, dialogs, allowedExtensions, _t) {
|
function ($rootScope, $scope, $state, $stateParams, Project, Machine, Member, Component, Theme, Licence, $document, CSRF, projectPromise, Diacritics, dialogs, allowedExtensions, _t) {
|
||||||
CSRF.setMetaTags();
|
/* PUBLIC SCOPE */
|
||||||
|
|
||||||
// API URL where the form will be posted
|
// API URL where the form will be posted
|
||||||
$scope.actionUrl = `/api/projects/${$stateParams.id}`;
|
$scope.actionUrl = `/api/projects/${$stateParams.id}`;
|
||||||
@ -462,8 +462,25 @@ Application.Controllers.controller('EditProjectController', ['$scope', '$state',
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Using the ProjectsController
|
/* PRIVATE SCOPE */
|
||||||
return new ProjectsController($scope, $state, Project, Machine, Member, Component, Theme, Licence, $document, Diacritics, dialogs, allowedExtensions, _t);
|
|
||||||
|
/**
|
||||||
|
* Kind of constructor: these actions will be realized first when the controller is loaded
|
||||||
|
*/
|
||||||
|
const initialize = function () {
|
||||||
|
CSRF.setMetaTags();
|
||||||
|
|
||||||
|
if ($scope.project.author_id !== $rootScope.currentUser.id && $scope.project.user_ids.indexOf($rootScope.currentUser.id) === -1) {
|
||||||
|
$state.go('app.public.projects_show', { id: $scope.project.slug });
|
||||||
|
console.error('[EditProjectController::initialize] user is not allowed')
|
||||||
|
}
|
||||||
|
|
||||||
|
// Using the ProjectsController
|
||||||
|
return new ProjectsController($scope, $state, Project, Machine, Member, Component, Theme, Licence, $document, Diacritics, dialogs, allowedExtensions, _t);
|
||||||
|
}
|
||||||
|
|
||||||
|
// !!! MUST BE CALLED AT THE END of the controller
|
||||||
|
return initialize();
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user