Author: sevein
Date: Thu May 17 17:41:42 2012
New Revision: 11690
Log:
Update user and groups pages to make use of the new slug-based ACL permissions
(instead of numeric ids). See issue 2263.
Modified:
trunk/apps/qubit/modules/user/actions/editAction.class.php
trunk/apps/qubit/modules/user/actions/indexInformationObjectAclAction.class.php
trunk/apps/qubit/modules/user/actions/indexTermAclAction.class.php
trunk/apps/qubit/modules/user/templates/indexInformationObjectAclSuccess.php
trunk/apps/qubit/modules/user/templates/indexTermAclSuccess.php
trunk/plugins/qbAclPlugin/modules/aclGroup/actions/editInformationObjectAclAction.class.php
trunk/plugins/qbAclPlugin/modules/aclGroup/actions/indexInformationObjectAclAction.class.php
trunk/plugins/qbAclPlugin/modules/aclGroup/actions/indexTermAclAction.class.php
trunk/plugins/qbAclPlugin/modules/aclGroup/actions/termAclFormComponent.class.php
trunk/plugins/qbAclPlugin/modules/aclGroup/templates/_termAclForm.php
trunk/plugins/qbAclPlugin/modules/aclGroup/templates/editInformationObjectAclSuccess.php
trunk/plugins/qbAclPlugin/modules/aclGroup/templates/indexInformationObjectAclSuccess.php
trunk/plugins/qbAclPlugin/modules/aclGroup/templates/indexTermAclSuccess.php
Modified: trunk/apps/qubit/modules/user/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/user/actions/editAction.class.php Thu May 17
17:39:50 2012 (r11689)
+++ trunk/apps/qubit/modules/user/actions/editAction.class.php Thu May 17
17:41:42 2012 (r11690)
@@ -56,8 +56,8 @@
foreach ($permissions as $item)
{
- $repoId = $item->getConstants(array('name' => 'repositoryId'));
- $this->permissions[$repoId][$item->objectId][$item->action] =
$item->grantDeny;
+ $repository = $item->getConstants(array('name' => 'repository'));
+ $this->permissions[$repository][$item->objectId][$item->action] =
$item->grantDeny;
}
}
Modified:
trunk/apps/qubit/modules/user/actions/indexInformationObjectAclAction.class.php
==============================================================================
---
trunk/apps/qubit/modules/user/actions/indexInformationObjectAclAction.class.php
Thu May 17 17:39:50 2012 (r11689)
+++
trunk/apps/qubit/modules/user/actions/indexInformationObjectAclAction.class.php
Thu May 17 17:41:42 2012 (r11690)
@@ -95,7 +95,7 @@
// Use username as "group" for permissions specific to user
$groupKey = (null !== $item->groupId) ? $item->groupId :
$this->resource->username;
- $this->acl[$item->getConstants(array('name' =>
'repositoryId'))][$objectId][$item->action][$groupKey] = $item;
+ $this->acl[$item->getConstants(array('name' =>
'repository'))][$objectId][$item->action][$groupKey] = $item;
}
}
}
Modified: trunk/apps/qubit/modules/user/actions/indexTermAclAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/user/actions/indexTermAclAction.class.php Thu May
17 17:39:50 2012 (r11689)
+++ trunk/apps/qubit/modules/user/actions/indexTermAclAction.class.php Thu May
17 17:41:42 2012 (r11690)
@@ -88,18 +88,18 @@
if ('createTerm' != $item->action)
{
- $taxonomyId = $item->getConstants(array('name' => 'taxonomyId'));
+ $taxonomy = $item->getConstants(array('name' => 'taxonomy'));
$action = $item->action;
}
else
{
// In this context permissions for all objects (null) and root object
// are equivalent
- $taxonomyId = (QubitTaxonomy::ROOT_ID != $item->objectId) ?
$item->objectId : null;
+ $taxonomy = (QubitTaxonomy::ROOT_ID != $item->objectId) ?
$item->objectId : null;
$action = 'create';
}
- $this->acl[$taxonomyId][$action][$roleKey] = $item;
+ $this->acl[$taxonomy][$action][$roleKey] = $item;
}
}
}
Modified:
trunk/apps/qubit/modules/user/templates/indexInformationObjectAclSuccess.php
==============================================================================
---
trunk/apps/qubit/modules/user/templates/indexInformationObjectAclSuccess.php
Thu May 17 17:39:50 2012 (r11689)
+++
trunk/apps/qubit/modules/user/templates/indexInformationObjectAclSuccess.php
Thu May 17 17:41:42 2012 (r11690)
@@ -19,14 +19,14 @@
<?php endforeach; ?>
</tr>
</thead><tbody>
- <?php foreach ($acl as $repoId => $objects): ?>
+ <?php foreach ($acl as $repository => $objects): ?>
<?php foreach ($objects as $objectId => $actions): ?>
<tr>
<td colspan="<?php echo $tableCols ?>"><strong>
- <?php if ('' == $repoId && '' == $objectId): ?>
+ <?php if ('' == $repository && '' == $objectId): ?>
<em><?php echo __('All %1%', array('%1%' =>
sfConfig::get('app_ui_label_informationobject'))) ?></em>
- <?php elseif ('' != $repoId): ?>
- <?php echo sfConfig::get('app_ui_label_repository').':
'.render_title(QubitRepository::getById($repoId)) ?>
+ <?php elseif ('' != $repository): ?>
+ <?php echo sfConfig::get('app_ui_label_repository').':
'.render_title(QubitRepository::getBySlug($repository)) ?>
<?php else: ?>
<?php echo
render_title(QubitInformationObject::getById($objectId)) ?>
<?php endif; ?>
Modified: trunk/apps/qubit/modules/user/templates/indexTermAclSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/user/templates/indexTermAclSuccess.php Thu May
17 17:39:50 2012 (r11689)
+++ trunk/apps/qubit/modules/user/templates/indexTermAclSuccess.php Thu May
17 17:41:42 2012 (r11690)
@@ -21,13 +21,13 @@
<?php endforeach; ?>
</tr>
</thead><tbody>
- <?php foreach ($acl as $taxonomyId => $actions): ?>
+ <?php foreach ($acl as $taxonomy => $actions): ?>
<tr>
<td colspan="<?php echo $tableCols ?>"><strong>
- <?php if ('' == $taxonomyId): ?>
+ <?php if ('' == $taxonomy): ?>
<em><?php echo __('All %1%', array('%1%' =>
sfConfig::get('app_ui_label_term'))) ?></em>
<?php else: ?>
- <?php echo __('Taxonomy: %1%', array('%1%' =>
render_title(QubitTaxonomy::getById($taxonomyId)))) ?>
+ <?php echo __('Taxonomy: %1%', array('%1%' =>
render_title(QubitTaxonomy::getBySlug($taxonomy)))) ?>
<?php endif; ?>
</strong></td>
</tr>
Modified:
trunk/plugins/qbAclPlugin/modules/aclGroup/actions/editInformationObjectAclAction.class.php
==============================================================================
---
trunk/plugins/qbAclPlugin/modules/aclGroup/actions/editInformationObjectAclAction.class.php
Thu May 17 17:39:50 2012 (r11689)
+++
trunk/plugins/qbAclPlugin/modules/aclGroup/actions/editInformationObjectAclAction.class.php
Thu May 17 17:41:42 2012 (r11690)
@@ -17,7 +17,7 @@
* along with Qubit Toolkit. If not, see <http://www.gnu.org/licenses/>.
*/
-class AclGroupEditInformationObjectAclAction extends
AclGroupEditDefaultAclAction
+class AclGroupEditInformationObjectAclAction extends
AclGroupEditDefaultAclAction
{
public static $NAMES = array(
'informationObject',
@@ -51,9 +51,9 @@
{
foreach ($permissions as $p)
{
- if (null != ($repoId = $p->getConstants(array('name' =>
'repositoryId'))))
+ if (null != ($repository = $p->getConstants(array('name' =>
'repository'))))
{
- $this->repositories[$repoId][$p->action] = $p;
+ $this->repositories[$repository][$p->action] = $p;
}
else if (null != $p->objectId && QubitInformationObject::ROOT_ID !=
$p->objectId)
{
Modified:
trunk/plugins/qbAclPlugin/modules/aclGroup/actions/indexInformationObjectAclAction.class.php
==============================================================================
---
trunk/plugins/qbAclPlugin/modules/aclGroup/actions/indexInformationObjectAclAction.class.php
Thu May 17 17:39:50 2012 (r11689)
+++
trunk/plugins/qbAclPlugin/modules/aclGroup/actions/indexInformationObjectAclAction.class.php
Thu May 17 17:41:42 2012 (r11690)
@@ -72,7 +72,7 @@
// object are equivalent
$objectId = (QubitInformationObject::ROOT_ID != $permission->objectId)
? $permission->objectId : null;
- $this->acl[$permission->getConstants(array('name' =>
'repositoryId'))][$objectId][$permission->action][$permission->groupId] =
$permission;
+ $this->acl[$permission->getConstants(array('name' =>
'repository'))][$objectId][$permission->action][$permission->groupId] =
$permission;
}
}
}
Modified:
trunk/plugins/qbAclPlugin/modules/aclGroup/actions/indexTermAclAction.class.php
==============================================================================
---
trunk/plugins/qbAclPlugin/modules/aclGroup/actions/indexTermAclAction.class.php
Thu May 17 17:39:50 2012 (r11689)
+++
trunk/plugins/qbAclPlugin/modules/aclGroup/actions/indexTermAclAction.class.php
Thu May 17 17:41:42 2012 (r11690)
@@ -69,18 +69,18 @@
{
if ('createTerm' != $permission->action)
{
- $taxonomyId = $permission->getConstants(array('name' =>
'taxonomyId'));
+ $taxonomy = $permission->getConstants(array('name' => 'taxonomy'));
$action = $permission->action;
}
else
{
// In this context permissions for all objects (null) and root object
// are equivalent
- $taxonomyId = (QubitTaxonomy::ROOT_ID != $permission->objectId) ?
$permission->objectId : null;
+ $taxonomy = (QubitTaxonomy::ROOT_ID != $permission->objectId) ?
$permission->objectId : null;
$action = 'create';
}
- $this->acl[$taxonomyId][$action][$permission->groupId] = $permission;
+ $this->acl[$taxonomy][$action][$permission->groupId] = $permission;
}
}
}
Modified:
trunk/plugins/qbAclPlugin/modules/aclGroup/actions/termAclFormComponent.class.php
==============================================================================
---
trunk/plugins/qbAclPlugin/modules/aclGroup/actions/termAclFormComponent.class.php
Thu May 17 17:39:50 2012 (r11689)
+++
trunk/plugins/qbAclPlugin/modules/aclGroup/actions/termAclFormComponent.class.php
Thu May 17 17:41:42 2012 (r11690)
@@ -45,13 +45,13 @@
$this->taxonomyPermissions[$item->objectId]['create'] = $item;
}
}
- else if (null === ($taxonomyId = $item->getConstants(array('name' =>
'taxonomyId'))))
+ else if (null === ($taxonomy = $item->getConstants(array('name' =>
'taxonomy'))))
{
$this->rootPermissions[$item->action] = $item;
}
else
{
- $this->taxonomyPermissions[$taxonomyId][$item->action] = $item;
+ $this->taxonomyPermissions[$taxonomy][$item->action] = $item;
}
}
}
Modified: trunk/plugins/qbAclPlugin/modules/aclGroup/templates/_termAclForm.php
==============================================================================
--- trunk/plugins/qbAclPlugin/modules/aclGroup/templates/_termAclForm.php
Thu May 17 17:39:50 2012 (r11689)
+++ trunk/plugins/qbAclPlugin/modules/aclGroup/templates/_termAclForm.php
Thu May 17 17:41:42 2012 (r11690)
@@ -58,7 +58,7 @@
<div class="form-item">
<table id="acl_<?php echo $key ?>">
- <caption><?php echo render_title(QubitTaxonomy::getById($key))
?></caption>
+ <caption><?php echo render_title(QubitTaxonomy::getBySlug($key))
?></caption>
<thead>
<tr>
<th scope="col"><?php echo __('Action') ?></th>
Modified:
trunk/plugins/qbAclPlugin/modules/aclGroup/templates/editInformationObjectAclSuccess.php
==============================================================================
---
trunk/plugins/qbAclPlugin/modules/aclGroup/templates/editInformationObjectAclSuccess.php
Thu May 17 17:39:50 2012 (r11689)
+++
trunk/plugins/qbAclPlugin/modules/aclGroup/templates/editInformationObjectAclSuccess.php
Thu May 17 17:41:42 2012 (r11690)
@@ -85,10 +85,10 @@
<legend><?php echo __('Permissions by %1%', array('%1%' =>
sfConfig::get('app_ui_label_repository'))) ?></legend>
<?php if (0 < count($repositories)): ?>
- <?php foreach ($repositories as $repositoryId => $permissions): ?>
- <div class="form-item">
-<?php echo get_component('aclGroup', 'aclTable', array('object' =>
QubitRepository::getById($repositoryId), 'permissions' => $permissions,
'actions' => $basicActions)) ?>
- </div>
+ <?php foreach ($repositories as $repository => $permissions): ?>
+ <div class="form-item">
+ <?php echo get_component('aclGroup', 'aclTable', array('object' =>
QubitRepository::getBySlug($repository), 'permissions' => $permissions,
'actions' => $basicActions)) ?>
+ </div>
<?php endforeach; ?>
<?php endif; ?>
Modified:
trunk/plugins/qbAclPlugin/modules/aclGroup/templates/indexInformationObjectAclSuccess.php
==============================================================================
---
trunk/plugins/qbAclPlugin/modules/aclGroup/templates/indexInformationObjectAclSuccess.php
Thu May 17 17:39:50 2012 (r11689)
+++
trunk/plugins/qbAclPlugin/modules/aclGroup/templates/indexInformationObjectAclSuccess.php
Thu May 17 17:41:42 2012 (r11690)
@@ -17,14 +17,14 @@
</thead>
<tbody>
- <?php foreach ($acl as $repoId => $objects): ?>
+ <?php foreach ($acl as $repository => $objects): ?>
<?php foreach ($objects as $objectId => $actions): ?>
<tr>
<td colspan="<?php echo $tableCols ?>"><strong>
- <?php if ('' == $repoId && '' == $objectId): ?>
+ <?php if ('' == $repository && '' == $objectId): ?>
<em><?php echo __('All %1%', array('%1%' =>
sfConfig::get('app_ui_label_informationobject'))) ?></em>
- <?php elseif ('' != $repoId): ?>
- <?php echo __('%1%: %2%', array('%1%' =>
sfConfig::get('app_ui_label_repository'), '%2%' =>
render_title(QubitRepository::getById($repoId)))) ?>
+ <?php elseif ('' != $repository): ?>
+ <?php echo __('%1%: %2%', array('%1%' =>
sfConfig::get('app_ui_label_repository'), '%2%' =>
render_title(QubitRepository::getBySlug($repository)))) ?>
<?php else: ?>
<?php echo render_title(QubitInformationObject::getById($objectId))
?>
<?php endif; ?>
Modified:
trunk/plugins/qbAclPlugin/modules/aclGroup/templates/indexTermAclSuccess.php
==============================================================================
---
trunk/plugins/qbAclPlugin/modules/aclGroup/templates/indexTermAclSuccess.php
Thu May 17 17:39:50 2012 (r11689)
+++
trunk/plugins/qbAclPlugin/modules/aclGroup/templates/indexTermAclSuccess.php
Thu May 17 17:41:42 2012 (r11690)
@@ -17,13 +17,13 @@
</thead>
<tbody>
- <?php foreach ($acl as $taxonomyId => $actions): ?>
+ <?php foreach ($acl as $taxonomy => $actions): ?>
<tr>
<td colspan="<?php echo $tableCols ?>"><strong>
- <?php if ('' == $taxonomyId): ?>
+ <?php if ('' == $taxonomy): ?>
<em><?php echo __('All %1%', array('%1%' =>
sfConfig::get('app_ui_label_term'))) ?></em>
<?php else: ?>
- <?php echo __('Taxonomy: %1%', array('%1%' =>
render_title(QubitTaxonomy::getById($taxonomyId)))) ?>
+ <?php echo __('Taxonomy: %1%', array('%1%' =>
render_title(QubitTaxonomy::getBySlug($taxonomy)))) ?>
<?php endif; ?>
</strong></td>
</tr>
--
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/qubit-commits?hl=en.