summaryrefslogtreecommitdiff
path: root/LibertySystem.php
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2007-03-31 13:01:09 +0000
committerMax Kremmel <xing@synapse.plus.com>2007-03-31 13:01:09 +0000
commit3acb24c80ff096fa757229e5113a08b071ed4251 (patch)
tree20509afa0ba372615fdf7a2dbf2a8a56785dcd5e /LibertySystem.php
parent3d5ce6f74a577cfb4d95a8c1ea6aac216b81a316 (diff)
downloadliberty-3acb24c80ff096fa757229e5113a08b071ed4251.tar.gz
liberty-3acb24c80ff096fa757229e5113a08b071ed4251.tar.bz2
liberty-3acb24c80ff096fa757229e5113a08b071ed4251.zip
lots of content permissions work. tentatively added updateUserPermissions() to service load function.
Diffstat (limited to 'LibertySystem.php')
-rwxr-xr-xLibertySystem.php25
1 files changed, 23 insertions, 2 deletions
diff --git a/LibertySystem.php b/LibertySystem.php
index d676ccf..257d67e 100755
--- a/LibertySystem.php
+++ b/LibertySystem.php
@@ -3,7 +3,7 @@
* System class for handling the liberty package
*
* @package liberty
-* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.65 2007/03/21 18:08:07 wjames5 Exp $
+* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.66 2007/03/31 13:01:08 squareing Exp $
* @author spider <spider@steelsun.com>
*/
@@ -745,6 +745,8 @@ function liberty_plugins_div_style( $pParamHash ) {
return $ret;
}
+
+// ================== Liberty Service Functions ==================
function liberty_content_load_sql() {
global $gBitSystem, $gBitUser;
$ret = array();
@@ -767,7 +769,7 @@ function liberty_content_list_sql() {
return $ret;
}
-function liberty_content_preview(&$pObject) {
+function liberty_content_preview( &$pObject ) {
global $gBitSystem, $gBitUser;
if ($gBitSystem->isFeatureActive('liberty_display_status') && ($gBitUser->hasPermission('p_liberty_edit_content_status') || $gBitUser->hasPermission('p_libert_edit_all_status'))) {
$pObject->mInfo['content_status_id'] = $_REQUEST['content_status_id'];
@@ -777,4 +779,23 @@ function liberty_content_preview(&$pObject) {
}
}
+function liberty_content_load( &$pObject ) {
+ if( $pObject->isValid() ) {
+ // transparently update user permissions for this content object
+ // this might not be the wisest course of action since it distorts permissions on the entire site with respect to the active package - xing
+ $pObject->updateUserPermissions();
+ }
+}
+
+function liberty_content_display( &$pObject, &$pParamHash ) {
+ if( $pObject->isValid() ) {
+ global $gBitUser, $gBitSystem;
+
+ // make sure user has appropriate permissions to view this content
+ if( !empty( $pParamHash['perm_name'] )) {
+ $pObject->verifyPermission( $pParamHash['perm_name'] );
+ }
+ }
+}
+
?>