Ticket #156 (closed enhancement: fixed)

Opened 10 months ago

Last modified 10 months ago

Update adminhandler and admin/groups for ACL

Reported by: michaeltwofish Owned by:
Priority: major Milestone: 0.4
Component: -none- Version: SVN
Keywords: ACL UserGroup groups permissions has_patch Cc:

Description

Attached is a patch for adminhandler and admin/groups that provides a UI for granting and denying permissions for groups. It works with the UserGroup class as provided in #152, in that it will grant and deny permissions.

However, there is a problem when constructing groups that have permissions assigned to them. A backtrace shows the error below.

#0 in system/classes/error.php:84:

Error::print_backtrace()

#1 in system/classes/usergroup.php:67:

Error::error_handler(

8, 'Indirect modification of overloaded property UserGroup::$db_permissions_denied has no effect', '/Applications/MAMP/htdocs/habari/system/classes/usergroup.php', 67, array (

'paramarray' => array ( ), 'result' => array ( ), 'results' => array (

0 => '1',

), 'denied' => '1', 'id' => 0,

)

)

#2 in [core]:0:

UserGroup->construct()

#3 in system/classes/databaseconnection.php:467:

PDOStatement->fetch()

#4 in system/classes/db.php:259:

DatabaseConnection->get_row(

'SELECT * FROM {groups} WHERE name=?', array (

0 => 'tester',

), 'UserGroup'

)

#5 in system/classes/usergroup.php:436:

DB::get_row(

'SELECT * FROM {groups} WHERE name=?', array (

0 => 'tester',

), 'UserGroup'

)

#6 in system/classes/usergroup.php:409:

UserGroup::get_by_name(

'tester'

)

#7 in system/classes/adminhandler.php:1030:

UserGroup::get(

'tester'

)

#8 in system/classes/adminhandler.php:47:

AdminHandler->post_groups()

#9 in system/classes/actionhandler.php:33:

AdminHandler->act_admin()

#10 in system/classes/controller.php:180:

ActionHandler->act(

'admin'

)

#11 in index.php:186:

Controller::dispatch_request()

Error: Indirect modification of overloaded property UserGroup::$db_permissions_denied has no effect

#0 in system/classes/error.php:84:

Error::print_backtrace()

#1 in system/classes/error.php:44:

Error::error_handler(

8, 'Undefined index: file', '/Applications/MAMP/htdocs/habari/system/classes/error.php', 44, array (

'exception' => Error::set_state(array(

'message' => 'Indirect modification of overloaded property UserGroup::$db_permissions_denied has no effect', 'string' => , 'code' => 0, 'file' => '/Applications/MAMP/htdocs/habari/system/classes/error.php', 'line' => 85, 'trace' =>

array (

0 => array (

'file' => '/Applications/MAMP/htdocs/habari/system/classes/usergroup.php', 'line' => 67, 'function' => 'error_handler', 'class' => 'Error', 'type' => '::', 'args' => array (

0 => 8, 1 => 'Indirect modification of overloaded property UserGroup::$db_permissions_denied has no effect', 2 => '/Applications/MAMP/htd...)

#2 in [core]:0:

Error::exception_handler()

Attachments

permissions_ui.patch (5.0 kB) - added by michaeltwofish 10 months ago.
156.diff (31.6 kB) - added by skippy 10 months ago.

Change History

Changed 10 months ago by michaeltwofish

Changed 10 months ago by skippy

I think I know what's causing the error. Investigating now.

Changed 10 months ago by skippy

Attached is a fairly substantial modification to ACL, UserGroup, the UI for group management.

Many UserGroup methods now accept arrays for bulk operation. You can grant, deny, revoke arrays of permissions. Similarly, you can add and remove arrays of users.

The UI on /admin/groups has been updated to use checkboxes, rather than drop-downs. This page really needs a complete overhaul so that you can modify permissions and users in one operation: currently you must modify users separately from permissions.

The status notifications need to be spruced up to handle the new array operations.

Session data needs to be saved so that you are shown the same screen as the one you just edited: having to re-select the group every time you modify users / permissions is a nuisance.

Changed 10 months ago by skippy

Changed 10 months ago by morydd

  • keywords has_patch added

Changed 10 months ago by miklb

  • status changed from new to closed
  • resolution set to fixed

r1343 covers this ticket - marking closed

Note: See TracTickets for help on using tickets.