Merge pull request #199 from Xen0ph0n/patch-3

Issue Exporting Events as IOC's when not SiteAdmin
2.1
iglocska 2013-12-19 12:33:44 -08:00
commit 05e720f972
2 changed files with 4 additions and 2 deletions

View File

@ -7,8 +7,10 @@ class IOCExportComponent extends Component {
public function buildAll($event, $isSiteAdmin, $isMyEvent) {
$temp = array();
if (!$isSiteAdmin) {
if ($event['Event']['distribution'] == 1 && !$isMyEvent && !isSiteAdmin) {
if (!$isMyEvent) {
if ($event['Event']['distribution'] == 0) {
throw new Exception('Nothing to see here (not authorised)');
}
}
}
$this->__buildTop($event);

View File

@ -2201,7 +2201,7 @@ class EventsController extends AppController {
//$event['Attribute'] = $this->Whitelist->removeWhitelistedFromArray($event['Attribute'], false);
// set up helper variables for the authorisation check in the component
$isMyEvent = false;
if ($this->Auth->User == $event['Event']['org']) $isMyEvent = true;
if ($this->Auth->User('org') == $event['Event']['org']) $isMyEvent = true;
$isSiteAdmin = $this->_isSiteAdmin();
// send the event and the vars needed to check authorisation to the Component