diff options
| author | wjames5 <will@tekimaki.com> | 2008-10-02 15:30:25 +0000 |
|---|---|---|
| committer | wjames5 <will@tekimaki.com> | 2008-10-02 15:30:25 +0000 |
| commit | c2c152d59a8138f1c9eb4bfb6ddc740238c18cf5 (patch) | |
| tree | 39b42755e8e644062f497e9c67d6c5b0f843247b | |
| parent | 991ebaf8c44bfd2be77224828f8a8029b4ecc60b (diff) | |
| download | liberty-c2c152d59a8138f1c9eb4bfb6ddc740238c18cf5.tar.gz liberty-c2c152d59a8138f1c9eb4bfb6ddc740238c18cf5.tar.bz2 liberty-c2c152d59a8138f1c9eb4bfb6ddc740238c18cf5.zip | |
init new 'create' permission check methods in anticipation of splitting edit into edit and create - edit is still unchanged at this point
| -rw-r--r-- | LibertyContent.php | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/LibertyContent.php b/LibertyContent.php index ae67097..535a59f 100644 --- a/LibertyContent.php +++ b/LibertyContent.php @@ -3,7 +3,7 @@ * Management of Liberty content * * @package liberty -* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.370 2008/08/23 19:36:27 spiderr Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.371 2008/10/02 15:30:25 wjames5 Exp $ * @author spider <spider@steelsun.com> */ @@ -1358,6 +1358,34 @@ class LibertyContent extends LibertyBase { } } + + /** + * Determine if current user has the ability to craete this type of content + * + * @return bool True if user has this type of content administration permission + */ + function hasCreatePermission( $pVerifyAccessControl=TRUE, $pCheckGlobalPerm=TRUE ) { + return( $this->hasUserPermission( $this->mCreateContentPerm, $pVerifyAccessControl, $pCheckGlobalPerm ) ); + } + + + // === verifyCreatePermission + /** + * Determine if current user has the ability to create this type of content + * Note this will always return FALSEif the content isValid + * + * @return bool True if user has this type of content administration permission + **/ + function verifyCreatePermission( $pVerifyAccessControl=TRUE, $pCheckGlobalPerm=TRUE ) { + global $gBitSystem; + if( !$this->isValid() && $this->hasCreatePermission( $pVerifyAccessControl, $pCheckGlobalPerm ) ) { + return TRUE; + } else { + $gBitSystem->fatalPermission( $this->mCreateContentPerm ); + } + } + + /** * Determine if current user has the ability to view this type of content * Note that this will always return TRUE if you haven't set the mViewContentPerm in your class |
