Skip to content

Instantly share code, notes, and snippets.

@jbennett
Created October 29, 2011 10:51
Show Gist options
  • Save jbennett/1324331 to your computer and use it in GitHub Desktop.
Save jbennett/1324331 to your computer and use it in GitHub Desktop.
Patch for Nooku authorizations
Index: administrator/components/com_default/controllers/behaviors/executable.php
===================================================================
--- administrator/components/com_default/controllers/behaviors/executable.php (revision 4344)
+++ administrator/components/com_default/controllers/behaviors/executable.php (working copy)
@@ -58,7 +58,7 @@
if(parent::canAdd())
{
if(version_compare(JVERSION,'1.6.0','ge')) {
- $result = JFactory::getUser()->authorise('core.create');
+ $result = JFactory::getUser()->authorise('core.create') === true;
} else {
$result = JFactory::getUser()->get('gid') > 22;
}
@@ -79,7 +79,7 @@
if(parent::canEdit())
{
if(version_compare(JVERSION,'1.6.0','ge')) {
- $result = JFactory::getUser()->authorise('core.edit');
+ $result = JFactory::getUser()->authorise('core.edit') === true;
} else {
$result = JFactory::getUser()->get('gid') > 22;
}
@@ -100,7 +100,7 @@
if(parent::canDelete())
{
if(version_compare(JVERSION,'1.6.0','ge')) {
- $result = JFactory::getUser()->authorise('core.delete');
+ $result = JFactory::getUser()->authorise('core.delete') === true;
} else {
$result = JFactory::getUser()->get('gid') > 22;
}
Index: site/components/com_default/controllers/behaviors/executable.php
===================================================================
--- site/components/com_default/controllers/behaviors/executable.php (revision 4344)
+++ site/components/com_default/controllers/behaviors/executable.php (working copy)
@@ -58,7 +58,7 @@
if(parent::canAdd())
{
if(version_compare(JVERSION,'1.6.0','ge')) {
- $result = JFactory::getUser()->authorise('core.create');
+ $result = JFactory::getUser()->authorise('core.create') === true;
} else {
$result = JFactory::getUser()->get('gid') > 18;
}
@@ -79,7 +79,7 @@
if(parent::canEdit())
{
if(version_compare(JVERSION,'1.6.0','ge')) {
- $result = JFactory::getUser()->authorise('core.edit');
+ $result = JFactory::getUser()->authorise('core.edit') === true;
} else {
$result = JFactory::getUser()->get('gid') > 19;
}
@@ -100,7 +100,7 @@
if(parent::canDelete())
{
if(version_compare(JVERSION,'1.6.0','ge')) {
- $result = JFactory::getUser()->authorise('core.delete');
+ $result = JFactory::getUser()->authorise('core.delete') === true;
} else {
$result = JFactory::getUser()->get('gid') > 20;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment