Changeset 468 for trunk/bin/acl.cli.php
- Timestamp:
- Feb 20, 2014 3:03:59 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property
svn:mergeinfo
set to
/branches/eli_branch merged eligible
-
Property
svn:mergeinfo
set to
-
trunk/bin/acl.cli.php
r415 r468 5 5 * For details visit the project site: <http://trac.strangecode.com/codebase/> 6 6 * Copyright 2001-2012 Strangecode, LLC 7 * 7 * 8 8 * This file is part of The Strangecode Codebase. 9 9 * … … 12 12 * Free Software Foundation, either version 3 of the License, or (at your option) 13 13 * any later version. 14 * 14 * 15 15 * The Strangecode Codebase is distributed in the hope that it will be useful, but 16 16 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 18 18 * details. 19 * 19 * 20 20 * You should have received a copy of the GNU General Public License along with 21 21 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 113 113 break; 114 114 case 'all' : 115 listObjects('root', 'aro'); 116 listObjects('root', 'aco'); 115 listObjects('root', 'aro'); 116 listObjects('root', 'aco'); 117 117 listObjects('root', 'axo'); 118 118 break; … … 238 238 but could just as easily be SPICES -> CUISINES -> DISHES. A privilege is 239 239 allowed if a user (ARO) can perform an action (ACO) on something (AXO). 240 For example, with an `ARO->ACO->AXO` of `Bob->edit->4`, Bob can edit article 4. 241 If the AXO were omitted (i.e. just `Bob->edit`), this becomes "Bob can edit" 240 For example, with an `ARO->ACO->AXO` of `Bob->edit->4`, Bob can edit article 4. 241 If the AXO were omitted (i.e. just `Bob->edit`), this becomes "Bob can edit" 242 242 (he can edit any object). 243 243 244 Each access object is stored as a node in hierarchical tree structures. 244 Each access object is stored as a node in hierarchical tree structures. 245 245 A permission granted to a node is applied to all its children. If a child 246 246 node is specified a different permission that is more specific than … … 252 252 253 253 Where command is any of the following (with arguments): 254 254 255 255 initdb 256 256 list [aro | aco | axo | all | perms] … … 268 268 revoke aro [aco] [axo] 269 269 delete [aro] [aco] [axo] 270 271 272 For the add*, mv*, grant, and revoke commands if any of the optional 273 args are not provided, 'root' is assumed. For the delete command 270 271 272 For the add*, mv*, grant, and revoke commands if any of the optional 273 args are not provided, 'root' is assumed. For the delete command 274 274 'null' is considered a wild-card to delete all objects of that type. 275 275 … … 297 297 $db =& DB::getInstance(); 298 298 global $this_script; 299 299 300 300 echo "\n"; 301 301 … … 324 324 $qid = $db->query("SELECT lft, rgt FROM $tbl WHERE name = '" . $db->escapeString($root) . "'"); 325 325 list($lft, $rgt) = mysql_fetch_row($qid); 326 326 327 327 $depth = array(); 328 328 329 329 // Retrieve all descendants of the root node 330 330 $qid = $db->query("SELECT name, lft, rgt, added_datetime FROM $tbl WHERE lft BETWEEN $lft AND $rgt ORDER BY lft ASC"); … … 334 334 array_pop($depth); 335 335 } 336 336 337 337 // Display indented node title. 338 338 printf("%-35s %-5s %-5s %s\n", str_repeat(' ', sizeof($depth)) . $name, $lft, $rgt, date($app->getParam('date_format'), strtotime($added_datetime))); 339 339 340 340 // Add this node to the stack. 341 341 $depth[] = $rgt; … … 356 356 $db =& DB::getInstance(); 357 357 global $this_script; 358 358 359 359 // Retrieve access value from db. 360 360 $qid = $db->query(" … … 371 371 while ($p = mysql_fetch_assoc($qid)) { 372 372 printf("%-25s %-25s %-25s \033[0;%sm%-6s\033[0m %-10s\n", $p['aro'], $p['aco'], $p['axo'], ('allow' == $p['access'] ? '32' : '31'), $p['access'], date($app->getParam('date_format'), strtotime($p['added_datetime']))); 373 } 374 } 375 376 377 ?> 373 } 374 } 375 376
Note: See TracChangeset
for help on using the changeset viewer.