Fixed a bug that allowed read-only users to create an event

pull/224/head
iglocska 2014-02-28 11:54:41 +01:00
parent 09f2e5a0bc
commit e07cb6e5e2
1 changed files with 3 additions and 0 deletions

View File

@ -474,6 +474,9 @@ class EventsController extends AppController {
* @return void
*/
public function add() {
if (!$this->role['perm_add']) {
throw new MethodNotAllowedException('You don\'t have permissions to create events');
}
if ($this->request->is('post')) {
if ($this->_isRest()) {
// Distribution, reporter for the events pushed will be the owner of the authentication key