Skip to content

Commit

Permalink
Change default event permissions to be NO_PERMISSIONS instead of 'OK'…
Browse files Browse the repository at this point in the history
… until saved. Closes #242
  • Loading branch information
brendo committed Aug 9, 2014
1 parent b72b93a commit 392e4af
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/class.role.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@ public function canAccessPage($page_id){
* `EventPermissions` constants, `NO_PERMISSIONS`, `OWN_ENTRIES`, `ALL_ENTRIES`
* or `CREATE`.
*
* @since Symphony 2.4
* This function defaults to false (`NO_PERMISSIONS`) if there are no matches.
* This means the Role must be updated with all the event permissions before the
* event can be used.
* @param string $event_handle
* @param string $action
* @param integer $required_level
Expand All @@ -332,8 +336,9 @@ public function canProcessEvent($event_handle, $action, $required_level){
return ($event_permissions[$event_handle][$action] >= $required_level);
}

// If the event wasn't in the array, then assume it's ok.
return true;
// If the event wasn't in the array, then assume it's not ok.
// Note this a change since Members 1.4. RE: #242.
return false;
}
}

Expand Down

0 comments on commit 392e4af

Please sign in to comment.