diff options
| author | Christian Fowler <spider@viovio.com> | 2008-10-20 21:40:11 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2008-10-20 21:40:11 +0000 |
| commit | faf5a5b9a775d3908d5aed36d51d841b079cef8e (patch) | |
| tree | fe7331ad6584e086bf378c8d3769ce9e9095e105 | |
| parent | 6b3126d694a6207a6e1dd8e489fef09556bc2256 (diff) | |
| download | pigeonholes-faf5a5b9a775d3908d5aed36d51d841b079cef8e.tar.gz pigeonholes-faf5a5b9a775d3908d5aed36d51d841b079cef8e.tar.bz2 pigeonholes-faf5a5b9a775d3908d5aed36d51d841b079cef8e.zip | |
BIG CHANGE: migrate p_*_edit permissions to p_*_update permission naming convention, hasEditPermission is now hasUpdatePermission, many explicit perm checks have been cleaned up to hasUpdatePermission
| -rw-r--r-- | Pigeonholes.php | 8 | ||||
| -rw-r--r-- | admin/schema_inc.php | 2 | ||||
| -rw-r--r-- | edit_pigeonholes.php | 8 | ||||
| -rw-r--r-- | edit_structure.php | 8 | ||||
| -rw-r--r-- | templates/list.tpl | 2 | ||||
| -rw-r--r-- | templates/menu_pigeonholes.tpl | 6 | ||||
| -rw-r--r-- | templates/section_inc.tpl | 4 | ||||
| -rw-r--r-- | templates/service_nav_path_inc.tpl | 2 | ||||
| -rw-r--r-- | view.php | 6 |
9 files changed, 23 insertions, 23 deletions
diff --git a/Pigeonholes.php b/Pigeonholes.php index 561df9a..507235a 100644 --- a/Pigeonholes.php +++ b/Pigeonholes.php @@ -1,6 +1,6 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_pigeonholes/Pigeonholes.php,v 1.128 2008/10/18 23:11:07 nickpalmer Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_pigeonholes/Pigeonholes.php,v 1.129 2008/10/20 21:40:11 spiderr Exp $ * * +----------------------------------------------------------------------+ * | Copyright ( c ) 2004, bitweaver.org @@ -17,7 +17,7 @@ * Pigeonholes class * * @author xing <xing@synapse.plus.com> - * @version $Revision: 1.128 $ + * @version $Revision: 1.129 $ * @package pigeonholes */ @@ -57,8 +57,8 @@ class Pigeonholes extends LibertyMime { // Permission setup $this->mViewContentPerm = 'p_pigeonholes_view'; - $this->mEditContentPerm = 'p_pigeonholes_edit'; - $this->mAdminContentPerm = 'p_pigeonholes_edit'; // use edit until we find the need for an admin permission + $this->mUpdateContentPerm = 'p_pigeonholes_update'; + $this->mAdminContentPerm = 'p_pigeonholes_update'; // use edit until we find the need for an admin permission // Allow specially constructed pigeonholes to mess with the // getMemberList SQL so that additional data can be added on. diff --git a/admin/schema_inc.php b/admin/schema_inc.php index ad59a40..5ac9e7e 100644 --- a/admin/schema_inc.php +++ b/admin/schema_inc.php @@ -46,7 +46,7 @@ $gBitInstaller->registerPreferences( PIGEONHOLES_PKG_NAME, array( $gBitInstaller->registerUserPermissions( PIGEONHOLES_PKG_NAME, array( array( 'p_pigeonholes_view', 'Can view pigeonholes', 'basic', PIGEONHOLES_PKG_NAME ), array( 'p_pigeonholes_insert_member', 'Can insert content into an existing pigeonhole', 'registered', PIGEONHOLES_PKG_NAME ), - array( 'p_pigeonholes_edit', 'Can edit pigeonholes', 'editors', PIGEONHOLES_PKG_NAME ), + array( 'p_pigeonholes_update', 'Can update pigeonholes', 'editors', PIGEONHOLES_PKG_NAME ), //array( 'p_pigeonholes_admin', 'Can administer all aspects of pigeonholes', 'editors', PIGEONHOLES_PKG_NAME ), ) ); diff --git a/edit_pigeonholes.php b/edit_pigeonholes.php index 92232e5..f711652 100644 --- a/edit_pigeonholes.php +++ b/edit_pigeonholes.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_pigeonholes/edit_pigeonholes.php,v 1.32 2008/06/25 22:21:17 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_pigeonholes/edit_pigeonholes.php,v 1.33 2008/10/20 21:40:11 spiderr Exp $ * * Copyright ( c ) 2004 bitweaver.org * Copyright ( c ) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: edit_pigeonholes.php,v 1.32 2008/06/25 22:21:17 spiderr Exp $ + * $Id: edit_pigeonholes.php,v 1.33 2008/10/20 21:40:11 spiderr Exp $ * @package pigeonholes * @subpackage functions */ @@ -19,14 +19,14 @@ require_once( '../bit_setup_inc.php' ); $gBitSystem->verifyPackage( 'pigeonholes' ); -$gBitSystem->verifyPermission( 'p_pigeonholes_edit' ); +$gBitSystem->verifyPermission( 'p_pigeonholes_create' ); include_once( LIBERTY_PKG_PATH.'LibertyStructure.php' ); include_once( PIGEONHOLES_PKG_PATH.'lookup_pigeonholes_inc.php' ); // include edit structure file only when structure_id is known if( !empty( $_REQUEST["structure_id"] ) && ( empty( $_REQUEST['action'] ) || $_REQUEST['action'] != 'remove' ) ) { - $verifyStructurePermission = 'p_pigeonholes_edit'; + $verifyStructurePermission = 'p_pigeonholes_create'; $noAjaxContent = TRUE; include_once( LIBERTY_PKG_PATH.'edit_structure_inc.php' ); diff --git a/edit_structure.php b/edit_structure.php index 6b8ffdd..d7e6c42 100644 --- a/edit_structure.php +++ b/edit_structure.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_pigeonholes/edit_structure.php,v 1.5 2008/06/25 22:21:17 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_pigeonholes/edit_structure.php,v 1.6 2008/10/20 21:40:11 spiderr Exp $ * * Copyright ( c ) 2004 bitweaver.org * Copyright ( c ) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: edit_structure.php,v 1.5 2008/06/25 22:21:17 spiderr Exp $ + * $Id: edit_structure.php,v 1.6 2008/10/20 21:40:11 spiderr Exp $ * @package pigeonholes * @subpackage functions */ @@ -19,7 +19,7 @@ require_once( '../bit_setup_inc.php' ); $gBitSystem->verifyPackage( 'pigeonholes' ); -$gBitSystem->verifyPermission( 'p_pigeonholes_edit' ); +$gBitSystem->verifyPermission( 'p_pigeonholes_create' ); // we need to load some javascript and css for this page $gBitThemes->loadCss( UTIL_PKG_PATH.'javascript/libs/mygosu/DynamicTree.css' ); @@ -30,7 +30,7 @@ $gBitThemes->loadJavascript( UTIL_PKG_PATH.'javascript/libs/mygosu/DynamicTreeBu include_once( PIGEONHOLES_PKG_PATH.'lookup_pigeonholes_inc.php' ); -$verifyStructurePermission = 'p_pigeonholes_edit'; +$verifyStructurePermission = 'p_pigeonholes_create'; include_once( LIBERTY_PKG_PATH.'edit_structure_inc.php' ); // Display the template diff --git a/templates/list.tpl b/templates/list.tpl index b5ec031..4bf55e4 100644 --- a/templates/list.tpl +++ b/templates/list.tpl @@ -27,7 +27,7 @@ <h1>{tr}Categories{/tr} <span class="total">[ {$listInfo.total_records|default:0} ]</span></h1> {foreach from=$pigeonList item=item} - {if $gBitUser->hasPermission( 'p_pigeonholes_edit' )} + {if $gBitUser->hasPermission( 'p_pigeonholes_update' )} <div class="floaticon"> {smartlink ititle="Change Structure" ifile="edit_structure.php" ibiticon="icons/view-refresh" structure_id=`$item.structure_id`} {smartlink ititle="Insert new Category" ifile="edit_pigeonholes.php" ibiticon="icons/document-new" structure_id=`$item.structure_id` action=create} diff --git a/templates/menu_pigeonholes.tpl b/templates/menu_pigeonholes.tpl index e1687df..1b3150f 100644 --- a/templates/menu_pigeonholes.tpl +++ b/templates/menu_pigeonholes.tpl @@ -1,6 +1,6 @@ {strip} <ul> - {if $gBitUser->hasPermission( 'p_pigeonholes_edit' )} + {if $gBitUser->hasPermission( 'p_pigeonholes_create' )} <li><a class="item" href="{$smarty.const.PIGEONHOLES_PKG_URL}edit_pigeonholes.php?action=create">{biticon iname="document-new" iexplain="Create Category" ilocation=menu}</a></li> {/if} @@ -8,7 +8,7 @@ <li><a class="item" href="{$smarty.const.PIGEONHOLES_PKG_URL}list.php">{biticon iname="format-justify-fill" iexplain="List Categories" ilocation=menu}</a></li> {if $gContent->mStructureId and $gContent->mType.content_type_guid == $smarty.const.PIGEONHOLES_CONTENT_TYPE_GUID} <li><a class="item" href="{$smarty.const.PIGEONHOLES_PKG_URL}{if $gBitSystem->isFeatureActive('pretty_urls_extended')}view/structure/{else}view.php?structure_id={/if}{$gContent->mStructureId}">{biticon iname=edit-find iexplain="View Category" ilocation=menu}</a></li> - {if $gBitUser->hasPermission( 'p_pigeonholes_edit' )} + {if $gBitUser->hasCreatePermission()} <li><a class="head" href="{$smarty.const.PIGEONHOLES_PKG_URL}edit_pigeonholes.php?structure_id={$gContent->getField('structure_id')}&action=edit">{biticon iname="accessories-text-editor" iexplain="Edit Category" ilocation=menu}</a></li> <li><a class="item" href="{$smarty.const.PIGEONHOLES_PKG_URL}edit_pigeonholes.php?structure_id={$gContent->getField('root_structure_id')}&action=create">{biticon iname="insert-object" iexplain="Insert Sub-Category" ilocation=menu}</a></li> <li><a class="item" href="{$smarty.const.PIGEONHOLES_PKG_URL}edit_structure.php?structure_id={$gContent->getField('structure_id')}">{biticon iname="view-refresh" iexplain="Change Structure" ilocation=menu}</a></li> @@ -17,7 +17,7 @@ {/if} {/if} - {if $gBitUser->hasPermission( 'p_pigeonholes_edit' )} + {if $gBitUser->hasPermission( 'p_pigeonholes_insert_member' )} <li><a class="item" href="{$smarty.const.PIGEONHOLES_PKG_URL}assign_content.php">{biticon iname="mail-attachment" iexplain="Assign Content" ilocation=menu}</a></li> {/if} </ul> diff --git a/templates/section_inc.tpl b/templates/section_inc.tpl index 88e2092..83ecb1c 100644 --- a/templates/section_inc.tpl +++ b/templates/section_inc.tpl @@ -35,7 +35,7 @@ <li> <a href="{$smarty.const.BIT_ROOT_URL}index.php?content_id={$pigeonMember.content_id}">{$pigeonMember.title|escape}</a> - {if $gBitUser->hasPermission( 'p_pigeonholes_edit' )} + {if $gBitUser->hasPermission( 'p_pigeonholes_insert_member' )} {smartlink ititle="Remove From Category" ibiticon="icons/edit-delete" expand_all=$smarty.request.expand_all action=dismember structure_id=$sid parent_id=$pigeonMember.parent_id pigeonhole_content_id=$pigeonMember.content_id} {/if} </li> @@ -55,7 +55,7 @@ {else} {* ======= very basic display of the pigoenhole structure ======= *} - {if !$no_edit and $gBitUser->hasPermission( 'p_pigeonholes_edit' )} + {if !$no_edit and $gBitUser->hasPermission( 'p_pigeonholes_update' )} <div class="floaticon"> {smartlink ititle="Insert new Category" ifile="edit_pigeonholes.php" ibiticon="icons/document-new" structure_id=`$subtree[ix].structure_id` action=create} {smartlink ititle="Edit Category" ibiticon="icons/accessories-text-editor" ifile="edit_pigeonholes.php" structure_id=$subtree[ix].structure_id action=edit} diff --git a/templates/service_nav_path_inc.tpl b/templates/service_nav_path_inc.tpl index fd598d0..16b5e5d 100644 --- a/templates/service_nav_path_inc.tpl +++ b/templates/service_nav_path_inc.tpl @@ -3,7 +3,7 @@ <div class="structurebar pigeonholesbar"> {foreach from=$pigeonData item=pigeonItem} <span class="path">{$pigeonItem.display_path} - {if $gBitUser->hasPermission( 'p_pigeonholes_edit' )} + {if $gContent->hasEditPermission()} {smartlink ititle="Remove Category" ibiticon="icons/edit-delete" ipackage=pigeonholes ifile=edit_pigeonholes.php action=dismember parent_id=$pigeonItem.content_id pigeonhole_content_id=$gContent->mContentId return_uri=$gContent->getDisplayUri()} {/if} </span> @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_pigeonholes/view.php,v 1.19 2008/06/25 22:21:17 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_pigeonholes/view.php,v 1.20 2008/10/20 21:40:11 spiderr Exp $ * * Copyright ( c ) 2004 bitweaver.org * Copyright ( c ) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: view.php,v 1.19 2008/06/25 22:21:17 spiderr Exp $ + * $Id: view.php,v 1.20 2008/10/20 21:40:11 spiderr Exp $ * @package pigeonholes * @subpackage functions */ @@ -40,7 +40,7 @@ $gStructure = new LibertyStructure( $gContent->mInfo['root_structure_id'] ); $gStructure->load(); if( !empty( $_REQUEST['action'] ) ) { - if( $_REQUEST['action'] == 'dismember' && !empty( $_REQUEST['content_id'] ) && !empty( $_REQUEST['parent_id'] ) && $gBitUser->hasPermission( 'p_pigeonholes_edit' ) ) { + if( $_REQUEST['action'] == 'dismember' && !empty( $_REQUEST['content_id'] ) && !empty( $_REQUEST['parent_id'] ) && $gContent->hasUserPermission() ) { if( $gContent->expungePigeonholeMember( array( 'parent_id' => $_REQUEST['content_id'], 'member_id' => $_REQUEST['parent_id'] ) ) ) { $feedback['success'] = tra( 'The item was successfully removed' ); } else { |
