/usr/share/phpgacl/docs/manual.html is in phpgacl 3.3.7-7.3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1">
<TITLE>phpGACL</TITLE>
<META NAME="GENERATOR" CONTENT="OpenOffice.org 2.0 (Linux)">
<META NAME="AUTHOR" CONTENT="jrussell">
<META NAME="CREATED" CONTENT="20030206;8320000">
<META NAME="CHANGED" CONTENT="20060903;16430300">
<META NAME="SDFOOTNOTE" CONTENT=";;;;P">
<META NAME="SDENDNOTE" CONTENT="ARABIC">
<STYLE TYPE="text/css">
<!--
@page { size: 8.27in 11.69in; margin: 1.18in }
P { margin-top: 0.08in; margin-bottom: 0.08in; color: #000000; line-height: 0.17in; widows: 2; orphans: 2 }
P.western { font-family: "Bitstream Vera Sans Mono", sans-serif; font-size: 10pt; so-language: en-US }
P.cjk { font-family: "Times New Roman", serif; font-size: 10pt; so-language: ja-JP }
H1 { margin-bottom: 0.04in; border-top: none; border-bottom: 1px solid #4700b8; border-left: 5.00pt solid #4700b8; border-right: none; padding-top: 0in; padding-bottom: 0.02in; padding-left: 0.02in; padding-right: 0in; color: #000000; widows: 2; orphans: 2; page-break-before: always }
H1.western { font-family: "Arial", sans-serif; font-size: 16pt; so-language: en-GB }
H1.cjk { font-family: "MS Mincho", "MS ??", monospace; font-size: 16pt; so-language: ja-JP }
H1.ctl { font-family: "Arial Unicode MS"; font-size: 12pt; font-weight: medium }
H2 { margin-bottom: 0.04in; color: #000000; widows: 2; orphans: 2 }
H2.western { font-family: "Georgia", serif; font-size: 13pt; so-language: en-GB; font-style: normal }
H2.cjk { font-family: "MS Mincho", "MS ??", monospace; font-size: 14pt; so-language: ja-JP; font-style: italic }
H2.ctl { font-family: "Arial Unicode MS"; font-size: 12pt; font-weight: medium }
H3 { margin-top: 0.08in; margin-bottom: 0.08in; color: #000000; line-height: 0.17in; widows: 2; orphans: 2 }
H3.western { font-family: "Helv", "Arial", sans-serif; font-size: 10pt; so-language: en-GB }
H3.cjk { font-family: "Times New Roman", serif; font-size: 10pt; so-language: ja-JP }
H3.ctl { font-family: "Arial Unicode MS"; font-size: 12pt; font-weight: medium }
H4 { margin-top: 0.08in; margin-bottom: 0.08in; color: #000000; line-height: 0.17in; widows: 2; orphans: 2 }
H4.western { font-family: "Helv", "Arial", sans-serif; font-size: 10pt; so-language: en-GB; font-style: italic; font-weight: medium }
H4.cjk { font-family: "Times New Roman", serif; font-size: 10pt; so-language: ja-JP; font-style: italic; font-weight: medium }
H4.ctl { font-family: "Arial Unicode MS"; font-size: 12pt; font-weight: medium }
A:link { color: #0000ff }
-->
</STYLE>
</HEAD>
<BODY LANG="en-US" TEXT="#000000" LINK="#0000ff" DIR="LTR">
<P LANG="en-GB" ALIGN=CENTER STYLE="margin-top: 0.17in; line-height: 100%; page-break-after: avoid">
<IMG SRC="manual_html_m54d0ced8.png" NAME="Graphic6" ALIGN=RIGHT WIDTH=165 HEIGHT=45 BORDER=0><BR CLEAR=RIGHT><BR><BR>
</P>
<P LANG="en-GB" ALIGN=CENTER STYLE="margin-top: 0.17in; line-height: 100%; page-break-after: avoid">
<FONT FACE="Luxi Sans, sans-serif"><FONT SIZE=5><B>Generic Access
Control Lists with PHP</B></FONT></FONT></P>
<P CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">Mike
Benoit <</FONT><FONT COLOR="#0000ff"><U><A HREF="mailto:ipso@snappymail.ca"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">ipso@snappymail.ca</FONT></A></U></FONT><FONT FACE="Bitstream Vera Sans Mono, sans-serif">><BR>James
Russell <</FONT><A HREF="mailto:james-phpgacl@ps2-pro.com"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">james-phpgacl@ps2-pro.com</FONT></A><FONT FACE="Bitstream Vera Sans Mono, sans-serif">><BR>Karsten
Dambekalns <</FONT><A HREF="mailto:k.dambekalns@fishfarm.de"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">k.dambekalns@fishfarm.de</FONT></A><FONT FACE="Bitstream Vera Sans Mono, sans-serif">></FONT></P>
<P CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">Copyright
© 2002-2006 Mike Benoit<BR>Copyright © 2003, James
Russell<BR>Copyright © 2003, Karsten Dambekalns</FONT></P>
<P CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">Document
Version: 60</FONT></P>
<P CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">Last
Updated:<B> <SDFIELD TYPE=DATETIME SDNUM="1033;1033;MMMM D, YYYY">September 3, 2006</SDFIELD>
- <SDFIELD TYPE=DATETIME SDVAL="37761.788287037" SDNUM="1033;1033;HH:MM AM/PM">06:55 PM</SDFIELD></B></FONT></P>
<H1 LANG="en-GB" CLASS="western">Table of Contents</H1>
<DIV ID="Table of Contents1" DIR="LTR" STYLE="background: transparent">
<P LANG="en-GB" STYLE="margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Table of Contents 2</FONT></P>
<P LANG="en-GB" STYLE="margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">About 4</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">What is it? 4</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Where can I get it? 4</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">What do I need to run it? 4</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Who is responsible for it? 4</FONT></P>
<P LANG="en-GB" STYLE="margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Introduction 5</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Understanding Access Control 5</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.33in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Who/Where 5</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.33in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Who/Where 6</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Defining access control with
phpGACL 6</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Fine-grain access control 8</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Multi-level Groups 8</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">How does phpGACL determine
permissions? 9</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Adding groups 10</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Adding people 11</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Resolving conflicts 11</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Naming Access Objects 12</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Adding Sections 14</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Multiple Purposes 15</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Access eXtension Objects 16</FONT></P>
<P LANG="en-GB" STYLE="margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Installation 18</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Basic setup 18</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Advanced setup 19</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.33in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Reusing an already existing ADOdb
installation 19</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.33in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Reusing an already existing Smarty
installation 20</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.33in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">How do I move the phpGACL files out
of my website tree while leaving a link in the tree for
administration? 20</FONT></P>
<P LANG="en-GB" STYLE="margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Using phpGACL in your application 21</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Basic usage 21</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Advanced usage 21</FONT></P>
<P LANG="en-GB" STYLE="margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Using the ACL admin utility 22</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">ACL's 22</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.33in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Creating 22</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.33in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Sections 23</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.33in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Extended Return Value 24</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.33in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Notes 24</FONT></P>
<P LANG="en-GB" STYLE="margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Glossary 25</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">ACO 25</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">ARO 25</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">AXO 25</FONT></P>
<P LANG="en-GB" STYLE="margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">References 26</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">phpGACL API 26</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">phpGACL Examples and Tutorials 26</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Access Control Resources 26</FONT></P>
<P LANG="en-GB" STYLE="margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">FAQ 27</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 0.17in; text-indent: 0in; margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<FONT FACE="Arial, sans-serif">Can phpGACL handle large sets of
data? 27</FONT></P>
</DIV>
<P LANG="en-GB" STYLE="margin-top: 0in; margin-bottom: 0.08in; line-height: 100%">
<BR><BR>
</P>
<H1 LANG="en-GB" CLASS="western">About</H1>
<H2 LANG="en-GB" CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">What
is it?</FONT></H2>
<P CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">phpGACL
is an set of functions that allows you to apply access control to
arbitrary objects (web pages, databases, etc) by other arbitrary
objects (users, remote hosts, etc).</FONT></P>
<P CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">It
offers fine-grained access control with simple management, and is
very fast.</FONT></P>
<P CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">It
is written in PHP (hence <B>php</B>GACL), a popular scripting
language that is commonly used to dynamically create web pages. The
GACL part of phpGACL stands for Generic Access Control List.</FONT></P>
<H2 LANG="en-GB" CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">Where
can I get it?</FONT></H2>
<P CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">phpGACL
is hosted by sourceforge.net at </FONT><A HREF="http://phpGACL.sourceforge.net/"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">http://phpGACL.sourceforge.net/</FONT></A></P>
<H2 LANG="en-GB" CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">What
do I need to run it?</FONT></H2>
<P CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">phpGACL
requires a relational database to store the access control
information. It accesses this database via an abstract wrapper called
</FONT><A HREF="http://php.weblogs.com/adodb"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">ADOdb</FONT></A><FONT FACE="Bitstream Vera Sans Mono, sans-serif">.
This is compatible with databases such as PostgreSQL, MySQL and
Oracle.</FONT></P>
<P CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">phpGACL
is written in the </FONT><A HREF="http://www.php.net/"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">PHP</FONT></A><FONT FACE="Bitstream Vera Sans Mono, sans-serif">
scripting language. It requires PHP 4.2 and above.</FONT></P>
<P CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">Access
Control List administration is performed by a web interface, and
therefore it is necessary to have a web server with PHP support, such
as </FONT><A HREF="http://httpd.apache.org/"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">Apache</FONT></A><FONT FACE="Bitstream Vera Sans Mono, sans-serif">.</FONT></P>
<H2 LANG="en-GB" CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">Who
is responsible for it?</FONT></H2>
<P CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">Mike
Benoit <</FONT><A HREF="mailto:ipso@snappymail.ca"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">ipso@snappymail.ca</FONT></A><FONT FACE="Bitstream Vera Sans Mono, sans-serif">>
is the author and project manager.</FONT></P>
<P CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">James
Russell <j</FONT><A HREF="mailto:ames-phpgacl@ps2-pro.com"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">ames-phpgacl@ps2-pro.com</FONT></A><FONT FACE="Bitstream Vera Sans Mono, sans-serif">>
and Karsten Dambekalns <</FONT><A HREF="mailto:k.dambekalns@fishfarm.de"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">k.dambekalns@fishfarm.de</FONT></A><FONT FACE="Bitstream Vera Sans Mono, sans-serif">>
did the documentation.</FONT></P>
<H1 LANG="en-GB" CLASS="western">Introduction</H1>
<H2 LANG="en-GB" CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">Understanding
Access Control</FONT></H2>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>The
best way to explain access control is to use examples with real
things rather than trying to relate to concepts.</FONT></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Han
is captain of the Millennium Falcon and Chewie is his second officer.
They've taken on board some passengers: Luke, Obi-wan, R2D2 and C3PO.
Han needs to define access restrictions for various rooms of the
ship: The Cockpit, Lounge, Engines and the external Guns.</FONT></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Han
says: "Me and Chewie should have access to everywhere, but after
a particularly messy hyperdrive repair, I forbid Chewie from going
near the Engine Room ever again. Passengers are confined to the
Passenger's Lounge."</FONT></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Let's
assume from now on that access is Boolean. That is, the result of
looking up a person's access to a room is either ALLOW or DENY. There
is no middle ground.</FONT></FONT></P>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=3><FONT SIZE=2><FONT COLOR="#000000"><SPAN LANG="en-US">If
we mapped this statement into an </SPAN><B>access matrix</B><SPAN LANG="en-US">
showing who has access to where, it would look something like this (O
means ALLOW, X means DENY):</SPAN></FONT></FONT></FONT></FONT></P>
<DL>
<DD>
<TABLE WIDTH=337 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=7 CELLSPACING=0>
<COL WIDTH=81>
<COL WIDTH=56>
<COL WIDTH=44>
<COL WIDTH=31>
<COL WIDTH=53>
<TR VALIGN=TOP>
<TD WIDTH=81>
<H3 LANG="en-GB" CLASS="western" ALIGN=RIGHT><FONT FACE="Bitstream Vera Sans Mono, sans-serif">Who/Where</FONT></H3>
</TD>
<TD WIDTH=56>
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Cockpit</FONT></FONT></P>
</TD>
<TD WIDTH=44>
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Lounge</FONT></FONT></P>
</TD>
<TD WIDTH=31>
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Guns</FONT></FONT></P>
</TD>
<TD WIDTH=53>
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Engines</FONT></FONT></P>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=81>
<P CLASS="western" ALIGN=RIGHT><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Han</FONT></FONT></P>
</TD>
<TD WIDTH=56 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=44 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=31 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=53 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=81>
<P CLASS="western" ALIGN=RIGHT><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Chewie</FONT></FONT></P>
</TD>
<TD WIDTH=56 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=44 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=31 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=53 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=81>
<P CLASS="western" ALIGN=RIGHT><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Obi-wan</FONT></FONT></P>
</TD>
<TD WIDTH=56 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
<TD WIDTH=44 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=31 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
<TD WIDTH=53 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=81>
<P CLASS="western" ALIGN=RIGHT><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Luke</FONT></FONT></P>
</TD>
<TD WIDTH=56 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
<TD WIDTH=44 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=31 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
<TD WIDTH=53 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=81>
<P CLASS="western" ALIGN=RIGHT><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>R2-D2</FONT></FONT></P>
</TD>
<TD WIDTH=56 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
<TD WIDTH=44 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=31 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
<TD WIDTH=53 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=81>
<P CLASS="western" ALIGN=RIGHT><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>C3PO</FONT></FONT></P>
</TD>
<TD WIDTH=56 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
<TD WIDTH=44 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=31 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
<TD WIDTH=53 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
</TR>
</TABLE>
</DL>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=3><FONT SIZE=2><FONT COLOR="#000000"><SPAN LANG="en-US">The
columns list the rooms that Han wants to restrict access to, and the
rows list the people that might request access to those rooms. More
generally, the "rooms" are "things to control access
on". We call these </SPAN><B>Access Control Objects</B><SPAN LANG="en-US">
(ACOs). The "people" are "things </SPAN><I>requesting</I><SPAN LANG="en-US">
access". We call these </SPAN><B>Access Request Objects</B><SPAN LANG="en-US">
(AROs). The </SPAN><I>people</I><SPAN LANG="en-US"> request access to
the </SPAN><I>rooms</I><SPAN LANG="en-US">, or in our terminology,
</SPAN><I>AROs</I><SPAN LANG="en-US"> request access to the </SPAN><I>ACOs</I><SPAN LANG="en-US">.</SPAN></FONT></FONT></FONT></FONT></P>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=3><FONT SIZE=2><FONT COLOR="#000000"><SPAN LANG="en-US">There
is a third type of Object, the </SPAN><B>Access eXtention Object</B><SPAN LANG="en-US">
(AXO) that we'll discuss later. These objects share many attributes
and are collectively referred to as Access Objects.</SPAN></FONT></FONT></FONT></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Managing
access using an access matrix like the one above has advantages and
disadvantages.</FONT></FONT></P>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2><I>Advantages:</I></FONT></FONT></P>
<UL>
<LI><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>It's
very fine-grained. It's possible to control access for an individual
person if necessary.</FONT></FONT></P>
<LI><P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=3><SPAN LANG="en-US"><FONT SIZE=2><FONT COLOR="#000000">It's
easy to see <U>who</U> has access to <U>what</U>. The answer is
stored in the intersection of the person and the room.</FONT></FONT></SPAN></FONT></FONT></P>
</UL>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2><I>Disadvantages:</I></FONT></FONT></P>
<UL>
<LI VALUE=1><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>It's
difficult to manage on a large scale. 6 passengers and 4 places is
fairly simple, but what if there were thousands of passengers and
hundreds of places, and you need to restrict access to large groups
of them at once, but still retain enough fine-grained control to
manage access for an individual? That would mean a lot of fiddly and
lengthy adjustment to the matrix, and it's a difficult task to
verify that the final matrix is correct.</FONT></FONT></P>
<LI><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>It's
hard to summarize or visualize. The above example is fairly simple
to summarize in a few sentences (as Han did above), but what if the
matrix looked like this?</FONT></FONT></P>
<TABLE WIDTH=337 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=7 CELLSPACING=0>
<COL WIDTH=81>
<COL WIDTH=52>
<COL WIDTH=44>
<COL WIDTH=35>
<COL WIDTH=54>
<TR VALIGN=TOP>
<TD WIDTH=81>
<H3 LANG="en-GB" CLASS="western" ALIGN=RIGHT><FONT FACE="Bitstream Vera Sans Mono, sans-serif">Who/Where</FONT></H3>
</TD>
<TD WIDTH=52>
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Cockpit</FONT></FONT></P>
</TD>
<TD WIDTH=44>
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Lounge</FONT></FONT></P>
</TD>
<TD WIDTH=35>
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Guns</FONT></FONT></P>
</TD>
<TD WIDTH=54>
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Engines</FONT></FONT></P>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=81>
<P CLASS="western" ALIGN=RIGHT><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Han</FONT></FONT></P>
</TD>
<TD WIDTH=52 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=44 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=35 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=54 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=81>
<P CLASS="western" ALIGN=RIGHT><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Chewie</FONT></FONT></P>
</TD>
<TD WIDTH=52 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=44 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
<TD WIDTH=35 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=54 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=81>
<P CLASS="western" ALIGN=RIGHT><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Obi-wan</FONT></FONT></P>
</TD>
<TD WIDTH=52 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
<TD WIDTH=44 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=35 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
<TD WIDTH=54 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=81>
<P CLASS="western" ALIGN=RIGHT><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Luke</FONT></FONT></P>
</TD>
<TD WIDTH=52 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=44 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=35 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=54 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=81>
<P CLASS="western" ALIGN=RIGHT><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>R2-D2</FONT></FONT></P>
</TD>
<TD WIDTH=52 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
<TD WIDTH=44 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=35 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
<TD WIDTH=54 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=81>
<P CLASS="western" ALIGN=RIGHT><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>C3PO</FONT></FONT></P>
</TD>
<TD WIDTH=52 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=44 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
<TD WIDTH=35 BGCOLOR="#ff0000">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>X</FONT></FONT></P>
</TD>
<TD WIDTH=54 BGCOLOR="#00ff00">
<P CLASS="western" ALIGN=CENTER><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>O</FONT></FONT></P>
</TD>
</TR>
</TABLE>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>This
matrix is not so obvious to summarize, and it's not clear to the
reader why those access decisions might have been made in the first
place.</FONT></FONT></P>
</UL>
<H2 LANG="en-GB" CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">Defining
access control with phpGACL</FONT></H2>
<P CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">It
seems that for large or complex situations, this 'access matrix'
approach is clearly unsuitable. We need a better system that
maintains the advantages (fine-grain control and a clear idea of <U>who</U>
has access to <U>what</U>) but removes the disadvantages (difficult
to summarize, and difficult to manage large groups of people at
once). One solution is phpGACL.</FONT></P>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=3><SPAN LANG="en-US"><FONT SIZE=2><FONT COLOR="#000000">phpGACL
doesn't describe access from the 'bottom-up' like the Access Matrix
above. Instead, it describes it 'top-down', like the textual
description of Han's access policy. This is a very flexible system
that allows you to manage access in large groups, it neatly
summarizes the access policy, and it's easy to see <U>who </U>has
access to <U>what</U>.</FONT></FONT></SPAN></FONT></FONT></P>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=3><FONT SIZE=2><FONT COLOR="#000000"><SPAN LANG="en-US">An
</SPAN><B>ARO tree</B><SPAN LANG="en-US"> defines a hierarchy of
</SPAN><B>Groups</B><SPAN LANG="en-US"> and AROs (things that request
access). This is very similar to a tree view of folders and files.
The 'folders' are the Groups and the 'files' are AROs.</SPAN></FONT></FONT></FONT></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Let's
make an ACL tree for the people on Han's ship. First we define some
categories for the people. It's clear that Han and Chewie run the
ship, and the rest of them are just passengers:</FONT></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Millennium
Falcon Passengers Group<BR>├─Crew Group<BR>│
├─Han ARO<BR>│
└─Chewie ARO<BR>└─Passengers Group<BR>
├─Obi-wan ARO<BR> ├─Luke ARO<BR>
├─R2D2 ARO<BR> └─C3PO ARO</FONT></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>This
tree by itself doesn't specify any access policy; it just shows how
we're grouping the people who might request access (AROs).</FONT></FONT></P>
<P CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">We
apply access restrictions by assigning instructions about a
particular room (ACO) to Groups or AROs in the tree. Han says: "By
default, no-one should be allowed access to any room on the
Millennium Falcon. But the Crew should have access to every room. The
Passengers should only have access to the Lounge."</FONT></P>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Times New Roman, serif"><FONT SIZE=3><FONT SIZE=2><FONT FACE="Courier New, monospace"><FONT COLOR="#000000"><SPAN LANG="en-US">Millennium
Falcon Passengers<BR>├─Crew </SPAN><B>[ALLOW: ALL]</B><SPAN LANG="en-US"><BR>│
├─Han<BR>│ └─Chewie<BR>└─Passengers </SPAN><B>[ALLOW:
Lounge]</B><SPAN LANG="en-US"><BR> ├─Obi-wan<BR>
├─Luke<BR> ├─R2D2<BR> └─C3PO</SPAN></FONT></FONT></FONT></FONT></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>To
interpret this ARO tree, we start from the top and work our way down.</FONT></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Firstly,
the default policy is always to deny access. Permissions have been
overridden for the "Crew", so they have access to
everywhere ("ALL" is a synonym for all rooms: "Cockpit,
Lounge, Guns, Engines"). The "Passengers" have access
only to the Lounge.</FONT></FONT></P>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=3><SPAN LANG="en-US"><FONT SIZE=2><FONT COLOR="#000000">This
way of describing the access policy is much clearer than the access
matrix. You can easily see who has access to what, and it's easier to
determine <U>why</U> they've got access (it seems obvious that Han
and Chewie would have access to everything, since they're grouped
under "Crew").</FONT></FONT></SPAN></FONT></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>To
summarize:</FONT></FONT></P>
<UL>
<LI VALUE=1><P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in">
<FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=3><FONT SIZE=2><FONT COLOR="#000000"><B>Access
Control Objects </B><SPAN LANG="en-US">(ACOs) are the things we want
to control access to (e.g. web pages, databases, rooms, etc).</SPAN></FONT></FONT></FONT></FONT></P>
<LI><P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=3><FONT SIZE=2><FONT COLOR="#000000"><B>Access
Request Objects</B><SPAN LANG="en-US"> (AROs) are the things that
request access (e.g. people, remote computers, etc)</SPAN></FONT></FONT></FONT></FONT></P>
<LI><P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=3><FONT SIZE=2><FONT COLOR="#000000"><B>ARO
trees</B><SPAN LANG="en-US"> define a hierarchy of </SPAN><B>Groups</B><SPAN LANG="en-US">
and AROs. Groups can contain other Groups and AROs.</SPAN></FONT></FONT></FONT></FONT></P>
<LI><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>The
default 'catch-all' policy for the ARO tree is always "DENY
ALL".</FONT></FONT></P>
<LI><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>To
assign access policy, work your way down the tree, explicitly
assigning permissions to Groups and AROs for each ACO as the need
arises.</FONT></FONT></P>
</UL>
<H2 LANG="en-GB" CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">Fine-grain
access control</FONT></H2>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Oops!
What about Chewie? By grouping him in "Crew", Han has
indirectly given him access to the Engines! He doesn't want that
after what Chewie recently did to the hyperdrive, so he adds a rule
to disallow this:</FONT></FONT></P>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Times New Roman, serif"><FONT SIZE=3><FONT SIZE=2><FONT FACE="Courier New, monospace"><FONT COLOR="#000000"><SPAN LANG="en-US">Millennium
Falcon Passengers<BR>├─Crew [ALLOW: ALL]<BR>│
├─Han<BR>│ └─Chewie </SPAN><B>[DENY:
Engines]</B><SPAN LANG="en-US"><BR>└─Passengers [ALLOW:
Lounge]<BR> ├─Obi-wan<BR> ├─Luke<BR>
├─R2D2<BR> └─C3PO</SPAN></FONT></FONT></FONT></FONT></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>This
is an example of the way you can control access policy in a
fine-grained manner. It is not necessary to move Chewie to another
Group; we simply over-ride the access policy at a lower level.</FONT></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Another
example of fine-grain control happens when the Empire attacks; Han
needs to let Luke man the guns, and let R2D2 repair the hyperdrive in
the Engine room. He can do this by over-riding the general
permissions granted by their status as a "Passenger":</FONT></FONT></P>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Times New Roman, serif"><FONT SIZE=3><FONT SIZE=2><FONT FACE="Courier New, monospace"><FONT COLOR="#000000"><SPAN LANG="en-US">Millennium
Falcon Passengers<BR>├─Crew [ALLOW: ALL]<BR>│
├─Han<BR>│ └─Chewie [DENY:
Engines]<BR>└─Passengers [ALLOW: Lounge]<BR> ├─Obi-wan<BR>
├─Luke </SPAN><B>[ALLOW: Guns]</B><SPAN LANG="en-US"><BR>
├─R2D2 </SPAN><B>[ALLOW: Engines]</B><SPAN LANG="en-US"><BR>
└─C3PO</SPAN></FONT></FONT></FONT></FONT></FONT></P>
<H2 CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">Multi-level
Groups</FONT></H2>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Groups
can be extended to any level in the ARO tree. For example, you could
add a Group "Jedi" to "Passengers". Most
passengers would be categorized under "Passengers", but
Luke and Obi-wan would be under "Jedi" and therefore might
be extended extra privileges (like access to the Cockpit):</FONT></FONT></P>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Times New Roman, serif"><FONT SIZE=3><FONT SIZE=2><FONT FACE="Courier New, monospace"><FONT COLOR="#000000"><SPAN LANG="en-US">Millennium
Falcon Passengers<BR>├─Crew [ALLOW: ALL]<BR>│
├─Han<BR>│ └─Chewie [DENY:
Engines]<BR>└─Passengers [ALLOW: Lounge]<BR>
├─</SPAN><B>Jedi [ALLOW: Cockpit]</B><SPAN LANG="en-US"><BR>
│ ├─</SPAN><B>Obi-wan</B><SPAN LANG="en-US"><BR>
│ └─</SPAN><B>Luke</B><SPAN LANG="en-US"> [ALLOW:
Guns] <BR> ├─R2D2 [ALLOW: Engines]<BR> └─C3PO</SPAN></FONT></FONT></FONT></FONT></FONT></P>
<H2 CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">How
does phpGACL determine permissions?</FONT></H2>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>When
the ship's computer (running phpGACL of course) checks access, the
only question it can ask itself is "Does person X have access to
room Y?" In phpGACL terms, this is rephrased as "Does ARO
'X' have access to ACO 'Y'?"</FONT></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>phpGACL
determines whether a specific person has access to a specific room by
working from the top of the ARO tree towards the specified person,
noting explicit access controls for that place along the way. When it
reaches that person, it uses the last explicit access control it
encountered as the result to return. In this way, you can define
access controls for groups of people, but over-ride them further down
the tree if you need to.</FONT></FONT></P>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=3><FONT SIZE=2><FONT COLOR="#000000"><B>Example
1</B><SPAN LANG="en-US">: We ask: "Does Luke have access to the
Lounge?".</SPAN></FONT></FONT></FONT></FONT></P>
<UL>
<LI VALUE=1><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Set
the default result, "DENY".</FONT></FONT></P>
<LI><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Work
out a path to Luke:</FONT></FONT></P>
</UL>
<H4 LANG="en-GB" CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"> Millennium
Falcon Passengers → Passengers → Jedi → Luke</FONT></H4>
<UL>
<LI VALUE=1><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Start
at the top of the tree and move towards Luke: The "Millennium
Falcon Passengers" node doesn't say anything about any room, so
do nothing here.</FONT></FONT></P>
<LI><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Move
on to "Passengers", which explicitly says that
"Passengers" have Lounge access, so change the internal
result to "ALLOW".</FONT></FONT></P>
<LI><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Move
to the "Jedi" node, which doesn't mention the Lounge at
all.</FONT></FONT></P>
<LI><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Finally
move to Luke's node, and again there's nothing there about the
Lounge.</FONT></FONT></P>
<LI><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>There's
nowhere left to go, so the result returned is the current value of
the internal result: "ALLOW"</FONT></FONT></P>
</UL>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=3><FONT SIZE=2><FONT COLOR="#000000"><B>Example
2</B><SPAN LANG="en-US">: We ask: "Does Chewie have access to
the Engines?"</SPAN></FONT></FONT></FONT></FONT></P>
<UL>
<LI VALUE=1><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Set
the default result, "DENY".</FONT></FONT></P>
<LI><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Work
out a path to Chewie:</FONT></FONT></P>
</UL>
<H4 LANG="en-GB" CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"> Millennium
Falcon Passengers → Crew → Chewie</FONT></H4>
<UL>
<LI><P CLASS="western">Start at the top of the tree and move towards
Chewie. The "Millennium Falcon Passengers" node doesn't
say anything about anywhere, so do nothing here.</P>
<LI><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Move
on to "Crew", which explicitly says that "Crew"
have Engine access, so change the internal result to "ALLOW".</FONT></FONT></P>
<LI><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Move
to Chewie's node, and there's an explicit rule saying that he
doesn't have access to the Engines, so change the internal result to
"DENY".</FONT></FONT></P>
<LI><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>There's
nowhere left to go, so the result returned is the current value of
the internal result: "DENY"</FONT></FONT></P>
</UL>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>As
you can see from the examples, if a Group doesn't explicitly specify
a permission for a room, then that Group inherits the access
restrictions of its parent for that room. If the root node
("Millennium Falcon Passengers") doesn't specify a
permission, it inherits it from the default setting ("DENY ALL"
in the above examples).</FONT></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>This
implies a couple of interesting points about the ARO tree:</FONT></FONT></P>
<UL>
<LI VALUE=1><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>The
ARO tree always shows the full list of the AROs. It would not make
sense to ask "Does Jabba have access to the Cockpit?"
because Jabba has not been defined in this system. However, phpGACL
does not check to see if AROs or ACOs exist before performing the
check, so if this question was actually asked then the result would
be the default "DENY".</FONT></FONT></P>
<LI><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>The
ARO tree may not display some defined ACOs, and relies on the
default setting to define access policy. For example, say Han
defined a "Bathroom" ACO. Any question like "Does
Luke have access to the Bathroom?" would have the answer
"DENY", because the default is "DENY" and
nowhere in the ARO tree does it ever explicitly mention the
Bathroom. Keep in mind when examining the ARO tree that some ACOs
may not be visible.</FONT></FONT></P>
</UL>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=3><FONT SIZE=2><FONT COLOR="#000000"><B>Note:</B><SPAN LANG="en-US">
When asking phpGACL questions about access to an ACO, it is not
possible to use Groups as AROs (even though it might 'seem' right).
For example, it is impossible to answer the question "Do
Passengers have access to Guns?" The complete answer is not a
Boolean "ALLOW" or "DENY", but the more complex
"Luke and Obi-wan can but R2D2 and C3PO cannot." phpGACL is
not designed to return that kind of answer.</SPAN></FONT></FONT></FONT></FONT></P>
<H2 CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">Adding
groups</FONT></H2>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Han
feels this ACL is starting to look a little complicated. There are so
many exceptions! Perhaps he should make another group, "Engineers",
containing the people who are allowed access to the Engines and Guns.
That group should contain Han and R2D2 since they're both capable of
repairing the engines and guns. This means Han can remove some of
those messy exceptions-to-the-rules, and that has the benefit of
making the description clearer:</FONT></FONT></P>
<P CLASS="western"><FONT FACE="Courier New, monospace">Default: DENY
ALL<BR>Millennium Falcon Passengers<BR>├─Crew [ALLOW:
ALL]<BR>│ ├─Han<BR>│ └─Chewie [DENY:
Engines]<BR>├─Passengers [ALLOW: Lounge]<BR>│
├─Jedi [ALLOW: Cockpit]<BR>│ │ ├─Obi-wan<BR>│
│ └─Luke [ALLOW: Guns] <BR>│ ├─R2D2<BR>│
└─C3PO<BR>└─<B>Engineers [ALLOW: Engines,
Guns]</B><BR> ├─<B>Han</B><BR> └─<B>R2D2</B></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>We
can read this as "By default, no-one has access to anywhere.
Crew have access to everywhere (except Chewie, who has no access to
the Engines). Passengers only have access to the Lounge, except Jedi
who also have access to the Cockpit. Luke has access to the Guns too.
Engineers are allowed access to the Engines and Guns."</FONT></FONT></P>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=3><FONT SIZE=2><FONT COLOR="#000000"><SPAN LANG="en-US">Most
importantly, we can see that Han and R2D2 are now in </SPAN><I>two</I><SPAN LANG="en-US">
places in the ACL. It is not necessary for them to be uniquely
categorized at all. This defines the policy more clearly to the
reader: "Ahh, Han and R2D2 have access to the Engines and Guns
because they're </SPAN><I>engineers</I><SPAN LANG="en-US">."</SPAN></FONT></FONT></FONT></FONT></P>
<H2 CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">Adding
people</FONT></H2>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>Han
goes to Cloud City to pick up Lando and get some repairs. Lando's the
Millennium Falcon's previous owner, so Han reckons he qualifies as
Crew. Lando also offers the services of his top engineer, Hontook,
for help with repairing the ship while they're in dock.</FONT></FONT></P>
<P CLASS="western"><FONT FACE="Courier New, monospace">Default: DENY
ALL<BR>Millennium Falcon Passengers<BR>├─Crew [ALLOW:
ALL]<BR>│ ├─Han<BR>│ ├─Chewie [DENY:
Engines]<BR>│ └─<B>Lando</B><BR>├─Passengers [ALLOW:
Lounge]<BR>│ ├─Jedi [ALLOW: Cockpit]<BR>│ │
├─Obi-wan<BR>│ │ └─Luke [ALLOW:
Guns] <BR>│ ├─R2D2<BR>│
└─C3PO<BR>└─Engineers [ALLOW: Engines,
Guns]<BR> ├─Han<BR> ├─R2D2<BR> └─<B>Hontook</B></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Bitstream Vera Sans Mono, sans-serif"><FONT SIZE=2>This
shows how easy it is to grant new people access. If we used the
original matrix scheme, we'd have to set permissions for each room
for both Lando and Hontook. Instead, we simply add them to their
appropriate groups and their access is implicitly and easily defined.</FONT></FONT></P>
<H2 CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">Resolving
conflicts</FONT></H2>
<P CLASS="western"><FONT FACE="Bitstream Vera Sans Mono, sans-serif">What
happens if we add Chewie to the list of Engineers?</FONT></P>
<P CLASS="western"><FONT FACE="Courier New, monospace">Default: DENY
ALL<BR>Millennium Falcon Passengers<BR>├─Crew [ALLOW:
ALL]<BR>│ ├─Han<BR>│ ├─Chewie [DENY:
Engines]<BR>│ └─Lando<BR>├─Passengers [ALLOW:
Lounge]<BR>│ ├─Jedi [ALLOW: Cockpit]<BR>│ │
├─Obi-wan<BR>│ │ └─Luke [ALLOW:
Guns] <BR>│ ├─R2D2<BR>│
└─C3PO<BR>└─Engineers [ALLOW: Engines,
Guns]<BR> ├─Han<BR> ├─R2D2<BR> ├─Hontook<BR>
└─<B>Chewie</B></FONT></P>
<P CLASS="western">This makes Chewie's access to the Engines
ambiguous, because now there are two paths from the root of the tree
to Chewie. If the ship's computer follows one path (along the "Crew"
branch), the result is "DENY access to Engines." If it
follows the other path (along the "Engineers" branch) then
the result is "ALLOW access to Engines". So, is he allowed
or denied?</P>
<P CLASS="western">phpGACL will warn you if you add or edit an
multiply-grouped ARO in such a way that the ARO's access to an
arbitrary ACO would be ambiguous. But it is <U>up to you</U> to
resolve the conflict.</P>
<P CLASS="western">If we now asked phpGACL the question "Does
Chewie have access to Engines?" the result returned is the
result given by the <U>last ACL entry to be modified</U> (this is
phpGACL's policy). In this case the result is ALLOW, because the
"ALLOW: Engines, Guns" directive assigned to the Engineers
Group is more recent than the "DENY: Engines" directive
assigned to Chewie's Group.</P>
<P CLASS="western">When ambiguous access entries exist in the ACL,
the ACL is said to be <B>inconsistent</B>. Inconsistent ACLs can be
very dangerous, and you may unwittingly provide access to
inappropriate people if you allow your ACL to remain in this state.
When phpGACL warns you that the ACL is inconsistent, it is best to
resolve the conflicts as soon as possible to regain consistency.</P>
<P CLASS="western">To resolve the conflict in this case, we could
either:</P>
<UL>
<LI VALUE=1><P CLASS="western">Remove the "DENY: Engines"
directive from Chewie's entry under the Crew Group.</P>
<LI><P CLASS="western">Add a "DENY: Engines" directive to
Chewie's entry under the Engineers Group.</P>
<LI><P CLASS="western">Remove Chewie from the Engineers Group, since
Han doesn't think him a worthy Engineer anyway.</P>
</UL>
<P CLASS="western">Han chooses option 3, and removes Chewie from the
Engineers list.</P>
<H2 CLASS="western">Naming Access Objects</H2>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>phpGACL
uniquely identifies each Access Object (AROs, AXOs and ACOs) with a
two-keyword combination and it's Access Object type.</FONT></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>The
tuple "(Access Object type, Section, Value)" uniquely
identifies any Access Object.</FONT></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>The
first element of the tuple is the type of Access Object (ARO, AXO or
ACO).</FONT></FONT></P>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Times New Roman, serif"><FONT SIZE=3><FONT SIZE=2><FONT FACE="Helv, Arial, sans-serif"><FONT COLOR="#000000"><SPAN LANG="en-US">The
second element of the tuple, called the </SPAN><B>Section</B><SPAN LANG="en-US">,
is a user-defined string which names the general category of the
Access Object. Multiple Access Objects can share the same Section
name. The Section name should be short but descriptive. It's used in
the user interface in selection boxes, so try not to make it too
long.</SPAN></FONT></FONT></FONT></FONT></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>Sections
are stored in a flat namespace; they are not nestable like Groups.
Sections have nothing to do with Groups or the ARO/AXO trees - they
are purely a mechanism for helping to maintain large numbers of
Access Objects.</FONT></FONT></P>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Times New Roman, serif"><FONT SIZE=3><FONT SIZE=2><FONT FACE="Helv, Arial, sans-serif"><FONT COLOR="#000000"><SPAN LANG="en-US">The
third element of the tuple is a user-defined name for the Access
Object, and is called the </SPAN><B>Value</B><SPAN LANG="en-US">. <U>A
Value cannot contain spaces</U> (however, a Section can).</SPAN></FONT></FONT></FONT></FONT></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2><U>Both
Section and Values are case sensitive.</U></FONT></FONT></P>
<P LANG="en-GB" CLASS="western" STYLE="margin-left: 0.38in; margin-top: 0in; margin-bottom: 0in; line-height: 0.17in">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3><FONT SIZE=2><FONT COLOR="#000000"><FONT FACE="Helv, Arial, sans-serif"><B>Aside:</B><SPAN LANG="en-US">
It is commonly asked why strings are used to identify Access Objects,
rather than integers which ostensibly seem faster. The answer is for
legibility. It is much easier to understand:<BR> </SPAN></FONT><SPAN LANG="en-US"><FONT FACE="Courier, Courier New, monospace">acl_check('system',
'login', 'users', 'john_doe');<BR></FONT><FONT FACE="Helv, Arial, sans-serif">than:</FONT><FONT FACE="Courier, Courier New, monospace"><BR> acl_check(10,
21004, 15, 20304);</FONT></SPAN></FONT></FONT></FONT></FONT></P>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Times New Roman, serif"><FONT SIZE=3><FONT SIZE=2><FONT FACE="Helv, Arial, sans-serif"><FONT COLOR="#000000"><SPAN LANG="en-US">Since
it is often obvious from the context which type of Access Object we
are referring to, the interface for phpGACL (and this documentation)
drops the Access Object type and uses the format "</SPAN><B>Section
> Value</B><SPAN LANG="en-US">" when displaying the name of
an Access Object. However, the API requires an Access Object's
"Section" and "Value" to be specified in separate
function arguments (the Access Object type is usually implicit in the
argument description).</SPAN></FONT></FONT></FONT></FONT></FONT></P>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2><B>Example
ACO "Section > Values":</B></FONT></FONT></P>
<UL>
<LI VALUE=1><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>"Floors
> 1st"</FONT></FONT></P>
<LI><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>"Floors
> 2nd"</FONT></FONT></P>
<LI><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>"Rooms
> Engines"</FONT></FONT></P>
</UL>
<P CLASS="western"><B>Example ARO "Section > Values":</B></P>
<UL>
<LI VALUE=1><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>"People
> John_Smith”</FONT></FONT></P>
<LI><P CLASS="western" STYLE="line-height: 0.17in">“<FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>People
> Cathy_Jones”</FONT></FONT></P>
<LI><P CLASS="western" STYLE="line-height: 0.17in">“<FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>Hosts
> sandbox.something.com”</FONT></FONT></P>
</UL>
<P CLASS="western"><B>Example API usage:</B></P>
<UL>
<LI VALUE=1><P CLASS="western" STYLE="font-weight: medium; line-height: 0.17in">
<FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>acl_check (
aco_section, aco_value, aro_section, aro_value);</FONT></FONT></P>
<LI><P CLASS="western" STYLE="font-weight: medium; line-height: 0.17in">
<FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>acl_check (
'Floors', '2nd', 'People', 'John_Smith' );</FONT></FONT></P>
</UL>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2><B>Valid
Naming Restrictions Examples:</B></FONT></FONT></P>
<UL>
<LI VALUE=1><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>"ACO
-Frob > Flerg", "ARO - Frob > Flerg" (The
Section and Value are the same in both, but this is fine as
namespaces are separate across Access Object types)</FONT></FONT></P>
<LI><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>"ACO
-Frob > Flerg", "ACO - Frob > Queegle" (The
Access Object type and Section are the same, but this is fine as the
Values are different)</FONT></FONT></P>
<LI><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>"AXO
- Frob Hrung > Flerg" (Sections can contain spaces)</FONT></FONT></P>
</UL>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2><B>Invalid
Naming Restrictions Examples:</B></FONT></FONT></P>
<UL>
<LI VALUE=1><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>"ACO
- Frob > Flerg", "ACO - Frob > Flerg" ("Access
Object type - Section > Value" must be unique)</FONT></FONT></P>
<LI><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>"ACO
- Frob > Flerg Habit" (Values cannot contain spaces)</FONT></FONT></P>
</UL>
<H2 LANG="en-GB" CLASS="western">Adding Sections</H2>
<P LANG="en-GB" STYLE="line-height: 100%"><FONT FACE="Helv, Arial, sans-serif">Before
you can add a new Access Object, its Section must be defined. To add
a new section, use the add_object_section() function.</FONT></P>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 100%"><FONT FACE="Arial, sans-serif"><FONT SIZE=2>add_object_section
(</FONT></FONT></P>
<P LANG="en-GB" STYLE="margin-left: 2.5in; text-indent: -2in; line-height: 100%">
<FONT FACE="Arial, sans-serif"><FONT FACE="Courier New, monospace">string
NAME,</FONT> A short description of what this Section is for. (e.g.
"Levels in building").</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 2.5in; text-indent: -2in; line-height: 100%">
<FONT FACE="Arial, sans-serif"><FONT FACE="Courier New, monospace">string
VALUE,</FONT> The name of the Section (e.g. "Floor").</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 2.5in; text-indent: -2in; line-height: 100%">
<FONT FACE="Arial, sans-serif"><FONT FACE="Courier New, monospace">int
ORDER,</FONT> An arbitrary value which affects the order this Section
appears in the UI.</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 2.5in; text-indent: -2in; line-height: 100%">
<FONT FACE="Arial, sans-serif"><FONT FACE="Courier New, monospace">bool
HIDDEN, </FONT>Whether this should appear in the UI or not (TRUE
means that is will be hidden).</FONT></P>
<P LANG="en-GB" STYLE="margin-left: 2.5in; text-indent: -2in; line-height: 100%">
<FONT FACE="Arial, sans-serif"><FONT FACE="Courier New, monospace">string
GROUP_TYPE) </FONT>The Access Object type ("aco", "aro"
or "axo")</FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>Han
creates 3 Sections for the AROs. "Humans", "Aliens"
and "Androids". Let's list the AROs with their full names</FONT></FONT></P>
<P CLASS="western"><FONT FACE="Courier New, monospace">Millennium
Falcon Passengers<BR>├─Crew [ALLOW: ALL]<BR>│
├─<B>"Humans > Han"</B><BR>│ ├─<B>"Aliens
> Chewie"</B> [DENY: Engines]<BR>│ └─<B>"Humans
> Lando"</B><BR>├─Passengers [ALLOW: Lounge]<BR>│
├─Jedi [ALLOW: Cockpit]<BR>│ │ ├─<B>"Humans
> Obi-wan"</B><BR>│ │ └─<B>"Humans
> Luke"</B> [ALLOW: Guns] <BR>│ ├─<B>"Androids
> R2D2"</B><BR>│ └─<B>"Androids >
C3PO"</B><BR>└─Engineers [ALLOW: Engines, Guns]<BR>
├─<B>"Humans > Han"</B><BR> ├─<B>"Androids
> R2D2"</B><BR> └─<B>"Aliens > Hontook"</B></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>Sections
are just a way of categorizing Access Objects, to make the user
interface more usable, and the code for acl_check() more readable.
They do not affect the way phpGACL determines access to an object.
They cannot be nested (so it would not be able to create a "Males"
sub-Section under "Humans" for example; you'd have to
create a Section called "Humans-Male" or similar)</FONT></FONT></P>
<H2 CLASS="western">Multiple Purposes</H2>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>You
may need to use phpGACL for multiple independent purposes. For
example, you may need to restrict user access to web pages, and also
remote host access to your server. The two tasks are not related.</FONT></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>phpGACL
can handle this in three different ways.</FONT></FONT></P>
<UL>
<LI VALUE=1><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>It
can use an alternative database to store the access tables.</FONT></FONT></P>
<LI><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>It
can use the same database but with differently named access tables.
(this feature is not implemented yet).</FONT></FONT></P>
<LI><P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>You
can store the Access Objects for both purposes in the same tables,
and carefully manage your list so that they don't conflict.</FONT></FONT></P>
</UL>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>To
implement Option 1 (and Option 2 when it becomes available), use the
$gacl_options array when creating a new phpGACL class. This allows
you to specify the database and table name prefixes to use:</FONT></FONT></P>
<P CLASS="western" STYLE="margin-top: 0in; margin-bottom: 0in; line-height: 0.17in">
<FONT FACE="Courier, Courier New, monospace"><FONT SIZE=2>$gacl_options
= array(<BR> 'db_table_prefix' => 'gacl_',<BR> 'db_type' =>
'mysql',<BR> 'db_host' => 'host1',<BR> 'db_user' =>
'user',<BR> 'db_password' => 'passwd',<BR> 'db_name' =>
'gacl');</FONT></FONT></P>
<P CLASS="western" STYLE="margin-top: 0in; margin-bottom: 0in; line-height: 0.17in">
<BR>
</P>
<P CLASS="western" STYLE="margin-top: 0in; margin-bottom: 0in; line-height: 0.17in">
<FONT FACE="Courier, Courier New, monospace"><FONT SIZE=2>$gacl_host1
= new gacl($gacl_options);</FONT></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>To
implement Option 3, you must be careful, since phpGACL doesn't know
the relationship between your different tasks, and it will be
possible to make meaningless Access Policy Directives.</FONT></FONT></P>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2>For
example, say Han wanted to restrict access to other ships contacting
his ship's computer, in addition to restricting access to the
different rooms. To do this, he might add "Luke's X-Wing
Fighter" as a remote ship ARO (in addition to other ships and an
ACO for the ship's computer). Because all AROs are in the same ARO
tree, it would be possible to create an APD like "Ships >
Luke's X-Wing Fighter" [ALLOW: "Rooms > Lounge"],
which would be totally meaningless! To help reduce mistakes like
this, good Section naming can make it clearer what Access Objects are
for which tasks. It should be obvious to any administrator that it's
meaningless to assign a Ship permission to use a Room.</FONT></FONT></P>
<H2 LANG="en-GB" CLASS="western">Access eXtension Objects</H2>
<P CLASS="western"><B>Access eXtension Objects</B> (AXOs) can add a
3rd dimension to the permissions that can be configured in phpGACL.
We've seen how phpGACL allows you to combine an ARO and an ACO (2
dimensions) to create an Access Policy Directive. This is great for
simple permission requests like:</P>
<P CLASS="western"> Luke (ARO) requests access to "Guns"
(ACO)</P>
<P CLASS="western">If that's all you need, that's fine - AXOs are
totally optional.</P>
<P CLASS="western">But because all ACOs are considered equal, it
makes it difficult to manage if there are many ACOs. If this is the
case, we can change the way we look at Access Objects to manage it
more easily.</P>
<P CLASS="western">AXOs are identical to AROs in many respects. There
is an AXO tree (separate from the ARO tree), with it's own Groups and
AXOs. When dealing with AXOs, consider an AXO to take the old role of
the ACO (i.e. "things to control access on"), and change
the view of ACOs from "things to control access on" to
"actions that are requested".</P>
<P CLASS="western"><B>ARO and ACO-only View:</B></P>
<UL>
<LI VALUE=1><P CLASS="western">AROs: Things requesting access</P>
<LI><P CLASS="western">ACOs: Things to control access on</P>
</UL>
<P CLASS="western"><B>ARO, ACO and AXO View:</B></P>
<UL>
<LI VALUE=1><P CLASS="western">AROs: Things requesting access</P>
<LI><P CLASS="western">ACOs: Actions that are requested</P>
<LI><P CLASS="western">AXOs: Things to control access on</P>
</UL>
<P CLASS="western"><B>Example:</B></P>
<P CLASS="western">A website manager is trying to manage access to
projects on the website. The ARO tree consists of all the users:</P>
<P CLASS="western"><FONT FACE="Courier New, monospace">Website<BR>├─Administrators<BR>│
├─Alice<BR>│ └─Carol<BR>└─Users<BR>
├─Bob<BR> └─Alan</FONT></P>
<P CLASS="western">The projects are organized by Operating System
into categories in the AXO tree:</P>
<P CLASS="western"><FONT FACE="Courier New, monospace">Projects<BR>├─Linux<BR>│
├─SpamFilter2<BR>│ └─AutoLinusWorshipper<BR>└─Windows<BR>
├─PaperclipKiller<BR> └─PopupStopper</FONT></P>
<P CLASS="western">The actions that can be taken with each project
are "View" and "Edit". These are the ACOs.</P>
<P CLASS="western">Now we want Bob to have "View" access to
all the Linux projects, so it's possible to add an ACL that links
Bob's ARO to the View ACO and the Linux AXO, and thus we can ask the
question:</P>
<P CLASS="western"> Bob (ARO) requests access to "View"
(ACO) the project(s) called "Linux" (AXO)</P>
<P CLASS="western">Keep in mind AXO's are optional, if you don't
specify an AXO when calling acl_check() and a matching ACL exists
with no AXO, it will be allowed. However if <U>only</U> ACLs exist
with AXO's, and you call acl_check() without an AXO, it will fail.</P>
<P CLASS="western">So basically as soon as you specify an AXO when
calling acl_check(), acl_check() will only search ACLs containing
AXO's. If no AXO is specified, only ACLs without AXOs are searched.
This in theory (I haven't benchmarked) gives us a slight performance
increase as well.</P>
<H1 LANG="en-GB" CLASS="western">Installation</H1>
<H2 LANG="en-GB" CLASS="western">Basic setup</H2>
<OL>
<LI><P CLASS="western">Untar the distribution .tar.gz file into the
root or a subdirectory of your web site. You might want to rename it
to something more suitable.<BR><BR><BR>
</P>
<P CLASS="western"><IMG SRC="manual_html_m48c2db5c.png" NAME="Graphic1" ALIGN=LEFT WIDTH=474 HEIGHT=146 BORDER=0><BR CLEAR=LEFT></P>
<LI><P CLASS="western">Edit phpgacl/gacl.ini.php using your
favourite editor and set the db_type, db_host, db_user, db_password,
and db_name you will be using.</P>
<LI><P CLASS="western">Create the database you specified in db_name
on the server.<BR><BR><BR>
</P>
<P CLASS="western"><IMG SRC="manual_html_m770a5a15.png" NAME="Graphic3" ALIGN=LEFT WIDTH=397 HEIGHT=123 BORDER=0><BR CLEAR=LEFT></P>
<P CLASS="western"></P>
<LI><P CLASS="western">Surf to
http://yoursite.net/phpgacl/setup.php. The required tables will be
installed based on your choice of database. Don't be afraid of the
truckload of output, if all goes well you will see only success
messages.<BR><BR><BR>
</P>
</OL>
<P CLASS="western"><IMG SRC="manual_html_7dced6ce.png" NAME="Graphic4" ALIGN=LEFT WIDTH=519 HEIGHT=504 BORDER=0><BR CLEAR=LEFT><BR><BR>
</P>
<OL START=5>
<LI><P CLASS="western">Now follow the last advice shown on that
screen and create the phpgacl/admin/smarty/templates_c directory. It
must be writable by the user the webserver runs as. If you don't do
this, you will not be able to use the CAL admin!</P>
<LI><P CLASS="western">Click the link at the bottom of the
successful setup page or surf
to:<BR>http://yoursite.net/phpgacl/admin/acl_admin.php</P>
</OL>
<H2 LANG="en-GB" CLASS="western">Advanced setup</H2>
<H3 LANG="en-GB" CLASS="western">Reusing an already existing ADOdb
installation</H3>
<P CLASS="western">If you already have ADOdb installed you can get
phpGACL to use this copy of ADOdb.</P>
<OL>
<LI><P CLASS="western">Edit phpgacl/gacl.class.php so that ADODB_DIR
reflects the location of the ADOdb library in your path.</P>
<LI><P CLASS="western">Rename the phpgacl/adodb folder to something
else like adodb_x and reload the phpgacl/admin/acl_admin.php page to
ensure it still works.</P>
<LI><P CLASS="western">Erase the adodb directory installed with
phpGACL.</P>
</OL>
<H3 LANG="en-GB" CLASS="western">Reusing an already existing Smarty
installation</H3>
<P CLASS="western">If you already have ADOdb installed you can get
phpGACL to use this copy of ADOdb.</P>
<OL>
<LI><P CLASS="western">Edit phpgacl/admin/gacl_admin.inc.php so that
the variables $smarty_dir and $smarty_compile_dir reflect the
location of the Smarty library in your path and the template_c
directory you already use.</P>
<P CLASS="western">Move the templates directory that came with
phpGACL to another directory (e.g. one level up). Adjust the
$smarty_template_dir so it points to the new location. If you like
you can move those templates to your existing templates folder, of
course.</P>
<LI><P CLASS="western">Rename the phpgacl/smarty folder to something
else like smarty_x and reload the phpgacl/admin/acl_admin.php page
to ensure it still works.</P>
<LI><P CLASS="western">Erase the smarty directory installed with
phpGACL.</P>
</OL>
<H3 LANG="en-GB" CLASS="western">How do I move the phpGACL files out
of my website tree while leaving a link in the tree for
administration?</H3>
<OL>
<LI><P CLASS="western">Go to your website root.</P>
<LI><P CLASS="western">Move the phpGACL directory to your includes
directory and create a symlink to the admin directory where you want
the admin tool to go. For example:</P>
<P CLASS="western">mv phpgacl/ /www/includes_directory<BR>ln -s
/www/includes_directory/phpgacl/admin/ gacl</P>
<LI><P CLASS="western">Now surfing to
http://yoursite.net/gacl/acl_admin.php will take you to the admin
page. If it doesn't work, make sure your Webserver allows symbolic
links in the website tree.</P>
</OL>
<H1 LANG="en-GB" CLASS="western">Using phpGACL in your application</H1>
<H2 LANG="en-GB" CLASS="western">Basic usage</H2>
<P CLASS="western">This example shows a basic example of using
phpGACL in your code. It uses the ADOdb abstraction layer as well,
and shows a simple way to validate a login attempt against a
database.</P>
<P CLASS="western"><FONT FACE="Courier New"><FONT COLOR="#ff0000">//
include basic ACL api</FONT><BR><FONT COLOR="#00cccc">include</FONT>('<FONT COLOR="#008000">phpgacl/gacl.class.php</FONT>');<BR>$<FONT COLOR="#ff6633">gacl</FONT>
= <FONT COLOR="#00cccc">new</FONT> gacl();</FONT></P>
<P CLASS="western"><FONT FACE="Courier New">$<FONT COLOR="#ff6633">username</FONT>
= $<FONT COLOR="#ff6633">db</FONT>-><FONT COLOR="#00cccc">quote</FONT>($<FONT COLOR="#ff6633">_POST</FONT>['<FONT COLOR="#008000">username</FONT>']);<BR>$<FONT COLOR="#ff6633">password</FONT>
= $<FONT COLOR="#ff6633">db</FONT>-><FONT COLOR="#00cccc">quote</FONT>(md5($<FONT COLOR="#ff6633">_POST</FONT>['<FONT COLOR="#008000">password</FONT>']));<BR>$<FONT COLOR="#ff6633">sql</FONT>
= '<FONT COLOR="#008000">SELECT name FROM users WHERE name=</FONT>';<BR>$<FONT COLOR="#ff6633">sql</FONT>
.= $<FONT COLOR="#ff6633">username</FONT>.' <FONT COLOR="#008000">AND
password=</FONT>'.$<FONT COLOR="#ff6633">password</FONT>;<BR>$<FONT COLOR="#ff6633">row</FONT>
= $<FONT COLOR="#ff6633">db</FONT>-><FONT COLOR="#00cccc">GetRow</FONT>($<FONT COLOR="#ff6633">sql</FONT>);</FONT></P>
<P CLASS="western"><FONT FACE="Courier New"><FONT COLOR="#00cccc">if</FONT>($<FONT COLOR="#ff6633">gacl</FONT>-><FONT COLOR="#00cccc">acl_check</FONT>('<FONT COLOR="#008000">system</FONT>','<FONT COLOR="#008000">login</FONT>','<FONT COLOR="#008000">user</FONT>',$<FONT COLOR="#ff6633">row</FONT>['<FONT COLOR="#008000">name</FONT>'])){<BR>
$<FONT COLOR="#ff6633">_SESSION</FONT>['<FONT COLOR="#008000">username</FONT>']
= $<FONT COLOR="#ff6633">row</FONT>['<FONT COLOR="#008000">name</FONT>'];<BR>
<FONT COLOR="#00cccc">return</FONT> <FONT COLOR="#6b4794">true</FONT>;<BR>}<BR><FONT COLOR="#00cccc">else</FONT><BR>
<FONT COLOR="#00cccc">return</FONT> <FONT COLOR="#6b4794">false</FONT>;</FONT></P>
<P CLASS="western">As you can see there is only one call to
acl_check() in this code. What does it do? Well, it</P>
<UL>
<LI><P CLASS="western">checks the ARO object $row['name'] from the
ARO section 'user'</P>
<LI><P CLASS="western">against the ACO object 'login' from the ACO
section 'system'.</P>
</UL>
<H2 LANG="en-GB" CLASS="western">Advanced usage</H2>
<P CLASS="western"><BR><BR>
</P>
<H1 LANG="en-GB" CLASS="western">Using the ACL admin utility</H1>
<P CLASS="western">If you want to get a grip on the included ACL
admin utitlity, it will help you a lot if you run the example.php
file. It contains some ACO, ARO and AXO objects, as well as some ACL
defined using those objects. After running it, you should see some
sample data in the admin interface.<BR><BR><BR>
</P>
<P CLASS="western"><IMG SRC="manual_html_4b803670.png" NAME="Graphic5" ALIGN=LEFT WIDTH=531 HEIGHT=488 BORDER=0><BR CLEAR=LEFT><BR><BR>
</P>
<P CLASS="western">Play around with it, and if you get stuck, come
back and read on...</P>
<P CLASS="western">(yet to be written)</P>
<H2 LANG="en-GB" CLASS="western">ACL's</H2>
<H3 LANG="en-GB" CLASS="western">Creating</H3>
<P CLASS="western">You must have a minimum of an ACO and an ARO
defined to create an ACL.</P>
<P CLASS="western">Select an ACO Section then select from the
available items show in the Access Control Objects list. Click the [
> > ] button to add the Section-ACO to the Selected list. You
may add any number of Section-ACO pairs to this list.</P>
<P CLASS="western"><IMG SRC="manual_html_m608b392a.png" NAME="Graphic9" ALIGN=LEFT WIDTH=531 HEIGHT=177 BORDER=0><BR CLEAR=LEFT><BR><BR>
</P>
<P CLASS="western">Next select an ARO Section. At this point you may
select from either the Access Request Objects list or from the ARO
Groups list.</P>
<P CLASS="western"><IMG SRC="manual_html_157037e7.png" NAME="Graphic10" ALIGN=LEFT WIDTH=531 HEIGHT=157 BORDER=0><BR CLEAR=LEFT><BR><BR>
</P>
<P CLASS="western">Select on of the ACL Sections (usually “user”
for this case), provide a brief description in the Note area and then
click Submit. Click on the “ACL Admin” tab and you will
see your new ACL in the list.</P>
<H3 LANG="en-GB" CLASS="western">Sections</H3>
<P CLASS="western"><IMG SRC="manual_html_676f8c98.png" NAME="Graphic7" ALIGN=LEFT WIDTH=518 HEIGHT=149 BORDER=0><BR CLEAR=LEFT>A
default install provides you with two ACL sections – 'system'
and 'user'. You would typically put user created ACL's (for example,
those you enter via the admin interface) in the 'user' section and
put ACL's generated by code in the 'system' section. However, you
can use the ACL sections to provide any other logical grouping that
suits your purposes.</P>
<H3 LANG="en-GB" CLASS="western">Extended Return Value</H3>
<P CLASS="western">Typically a call to the acl_check method will
return a boolean value. However, you may specify a different value
or evan a string to be returned.
</P>
<P CLASS="western">For example, you may negotiate for a user to login
at a cost of $0.20 per time by default and another for $0.18 per time
under a different scheme. You could create a separate ACL for the
default login and for the special use but varying the 'return value'.
If the call to acl_check is successful, you will know the cost of
the login via the return value.</P>
<H3 LANG="en-GB" CLASS="western">Notes</H3>
<P CLASS="western">It's a good idea to add a note when creating an
ACL to help remember it's purpose, for example “Basic
permissions for a user in the Administrator group”.</P>
<P CLASS="western"><IMG SRC="manual_html_m4f4324cb.png" NAME="Graphic8" ALIGN=LEFT WIDTH=526 HEIGHT=120 BORDER=0><BR CLEAR=LEFT><BR><BR>
</P>
<H1 LANG="en-GB" CLASS="western"><A NAME="Glossary"></A>Glossary</H1>
<H2 LANG="en-GB" CLASS="western">ACO</H2>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2><DFN>Access
Control Object – An action that are requested to be performed.</DFN></FONT></FONT></P>
<H2 LANG="en-GB" CLASS="western">ARO</H2>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2><DFN><SPAN LANG="en-US"><FONT SIZE=2><FONT FACE="Helv, Arial, sans-serif"><FONT COLOR="#000000">Access
Request Object – An entity (for example, a user) that is
requesting an action to be performed.</FONT></FONT></FONT></SPAN></DFN></FONT></FONT></P>
<H2 LANG="en-GB" CLASS="western">AXO</H2>
<P CLASS="western" STYLE="line-height: 0.17in"><FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2><DFN><SPAN LANG="en-US"><FONT SIZE=2><FONT FACE="Helv, Arial, sans-serif"><FONT COLOR="#000000">Access
eXtension Object – An object to perform an action on for an
entity.</FONT></FONT></FONT></SPAN></DFN></FONT></FONT></P>
<H1 LANG="en-GB" CLASS="western">References</H1>
<H2 LANG="en-GB" CLASS="western">phpGACL API</H2>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 100%"><FONT FACE="Helv, Arial"><FONT SIZE=2>The
API documentation is included in the tarball under the /docs/phpdoc/
directory.</FONT></FONT></P>
<H2 LANG="en-GB" CLASS="western">phpGACL Examples and Tutorials</H2>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 100%"><FONT FACE="Helv, Arial"><FONT SIZE=2>See
example.php included in the tarball.</FONT></FONT></P>
<H2 LANG="en-GB" CLASS="western">Access Control Resources</H2>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 100%"><FONT FACE="Helv, Arial"><FONT SIZE=2>.
. .</FONT></FONT></P>
<P CLASS="western"><BR><BR>
</P>
<H1 LANG="en-GB" CLASS="western">FAQ</H1>
<H2 LANG="en-GB" CLASS="western">Can phpGACL handle large sets of
data?</H2>
<P LANG="en-GB" CLASS="western" STYLE="line-height: 100%"><FONT FACE="Helv, Arial"><FONT SIZE=2>Not
a problem at all. We've tested up to 100,000 AXO's and 100,000 ARO's
on moderate hardware even. The performance issues come down to how
well you can cache the ACL's, and how fast your database server is.</FONT></FONT></P>
</BODY>
</HTML>
|