Changeset 2864
- Timestamp:
- 11/24/08 04:54:57 (7 weeks ago)
- Location:
- trunk/htdocs/system/classes
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/htdocs/system/classes/acl.php
r2862 r2864 36 36 $bitmask = new Bitmask( self::$access_names, $permission ); 37 37 38 if ( $access == 'full' ) { 39 return $bitmask->read && $bitmask->write; 40 } 41 return $bitmask->$access; 38 switch($access) { 39 case 'full': 40 return $bitmask->value == $bitmask->full; 41 case 'any': 42 return $bitmask->value != 0; 43 default: 44 return $bitmask->$access; 45 } 42 46 } 43 47 -
trunk/htdocs/system/classes/bitmask.php
r2862 r2864 68 68 { 69 69 if ( is_string( $bit ) ) { 70 $bit = array_search( $bit, $this->flags ); 70 if($bit == 'full') { 71 return (1 << (count($this->flags) - 1)) - 1; 72 } 73 else { 74 $bit = array_search( $bit, $this->flags ); 75 } 71 76 } 72 77 if ( $bit === false ) … … 77 82 } 78 83 ?> 79 -
trunk/htdocs/system/classes/user.php
r2862 r2864 411 411 * @return boolean True if this user has the requested permission, false if not 412 412 */ 413 public function can( $permission, $access = ' full' )413 public function can( $permission, $access = 'any' ) 414 414 { 415 415 return ACL::user_can( $this, $permission, $access );
