/**
  * info card for this role
  *
  * @view /views/scripts/role/info.phtml
  * @access public
  * @todo show permissions to ressources
  */
 public function infoAction()
 {
     $roleRow = new Admin_Model_DbRow_Role($this->dbRole->find($this->checkRoleIdParam()));
     $groups = array();
     $users = array();
     $inherits = array();
     foreach ($this->dbRoleMember->getRoleBindingTo($roleRow->get('id'), 'group') as $row) {
         $groups[] = new Admin_Model_DbRow_Group($row);
     }
     foreach ($this->dbRoleMember->getRoleBindingTo($roleRow->get('id'), 'user') as $row) {
         $users[] = new Admin_Model_DbRow_User($row);
     }
     foreach ($this->dbRoleInherit->getRoleInheritance($roleRow->get('id')) as $row) {
         $inherits[] = new Admin_Model_DbRow_Role($row);
     }
     $this->view->role = $roleRow;
     $this->view->groups = $groups;
     $this->view->users = $users;
     $this->view->inherits = $inherits;
 }
 /**
  * Load all roles for roles listing
  *
  * @return array
  */
 public function loadRoleRolesAction()
 {
     $return = array();
     $roleModel = new Admin_Model_DbTable_Acl_Role();
     $roleMemberModel = new Admin_Model_DbTable_Acl_RoleMember();
     $roleInheritModel = new Admin_Model_DbTable_Acl_RoleInherit();
     $roles = $roleModel->fetchAll();
     foreach ($roles as $roleRow) {
         $users = $groups = $inherits = array();
         $role = new Admin_Model_DbRow_Role($roleRow);
         foreach ($roleMemberModel->getRoleUsers($roleRow['uar_id']) as $userRow) {
             $user = new Admin_Model_DbRow_User($userRow);
             $users[] = $user->toJsonArray();
         }
         foreach ($roleMemberModel->getRoleGroups($roleRow['uar_id']) as $groupRow) {
             $group = new Admin_Model_DbRow_Group($groupRow);
             $groups[] = $group->toJsonArray();
         }
         foreach ($roleInheritModel->getRoleInheritance($roleRow['uar_id']) as $inheritRow) {
             $inherit = new Admin_Model_DbRow_Role($inheritRow);
             $inherits[] = $inherit->toJsonArray();
         }
         $return[] = array_merge($role->toJsonArray(), array('users' => $users, 'groups' => $groups, 'inherits' => $inherits));
     }
     return $this->responseSuccess(array('roles' => $return));
 }