Fossil SCM
Add the "E" and "F" capability letters to control reading and writing to the synclog.
Commit
06b3ace4ce190c5f7d95e0b5a220eafca1d5e1559d834073324dce892b8afe26
Parent
42a6191e9366a2f…
4 files changed
+5
-1
+6
-1
+2
+4
+5
-1
| --- src/capabilities.c | ||
| +++ src/capabilities.c | ||
| @@ -100,11 +100,11 @@ | ||
| 100 | 100 | void capability_expand(CapabilityString *pIn){ |
| 101 | 101 | static char *zNobody = 0; |
| 102 | 102 | static char *zAnon = 0; |
| 103 | 103 | static char *zReader = 0; |
| 104 | 104 | static char *zDev = 0; |
| 105 | - static char *zAdmin = "bcdefghijklmnopqrtwz234567AD"; | |
| 105 | + static char *zAdmin = "bcdefghijklmnopqrtwz234567ADEF"; | |
| 106 | 106 | int doneV = 0; |
| 107 | 107 | |
| 108 | 108 | if( pIn==0 ){ |
| 109 | 109 | fossil_free(zNobody); zNobody = 0; |
| 110 | 110 | fossil_free(zAnon); zAnon = 0; |
| @@ -308,10 +308,14 @@ | ||
| 308 | 308 | "Announce", "Send announcements to all subscribers" }, |
| 309 | 309 | { 'C', CAPCLASS_FORUM, 0, |
| 310 | 310 | "Chat", "Read and/or writes messages in the chatroom" }, |
| 311 | 311 | { 'D', CAPCLASS_OTHER, 0, |
| 312 | 312 | "Debug", "Enable debugging features" }, |
| 313 | + { 'E', CAPCLASS_SUPER, 0, | |
| 314 | + "Read SyncLog", "Read the SyncLog" }, | |
| 315 | + { 'F', CAPCLASS_SUPER, 0, | |
| 316 | + "Update SyncLog", "Add or modify entries in the SyncLog" }, | |
| 313 | 317 | }; |
| 314 | 318 | |
| 315 | 319 | /* |
| 316 | 320 | ** Populate the aCap[].nUser values based on the current content |
| 317 | 321 | ** of the USER table. |
| 318 | 322 |
| --- src/capabilities.c | |
| +++ src/capabilities.c | |
| @@ -100,11 +100,11 @@ | |
| 100 | void capability_expand(CapabilityString *pIn){ |
| 101 | static char *zNobody = 0; |
| 102 | static char *zAnon = 0; |
| 103 | static char *zReader = 0; |
| 104 | static char *zDev = 0; |
| 105 | static char *zAdmin = "bcdefghijklmnopqrtwz234567AD"; |
| 106 | int doneV = 0; |
| 107 | |
| 108 | if( pIn==0 ){ |
| 109 | fossil_free(zNobody); zNobody = 0; |
| 110 | fossil_free(zAnon); zAnon = 0; |
| @@ -308,10 +308,14 @@ | |
| 308 | "Announce", "Send announcements to all subscribers" }, |
| 309 | { 'C', CAPCLASS_FORUM, 0, |
| 310 | "Chat", "Read and/or writes messages in the chatroom" }, |
| 311 | { 'D', CAPCLASS_OTHER, 0, |
| 312 | "Debug", "Enable debugging features" }, |
| 313 | }; |
| 314 | |
| 315 | /* |
| 316 | ** Populate the aCap[].nUser values based on the current content |
| 317 | ** of the USER table. |
| 318 |
| --- src/capabilities.c | |
| +++ src/capabilities.c | |
| @@ -100,11 +100,11 @@ | |
| 100 | void capability_expand(CapabilityString *pIn){ |
| 101 | static char *zNobody = 0; |
| 102 | static char *zAnon = 0; |
| 103 | static char *zReader = 0; |
| 104 | static char *zDev = 0; |
| 105 | static char *zAdmin = "bcdefghijklmnopqrtwz234567ADEF"; |
| 106 | int doneV = 0; |
| 107 | |
| 108 | if( pIn==0 ){ |
| 109 | fossil_free(zNobody); zNobody = 0; |
| 110 | fossil_free(zAnon); zAnon = 0; |
| @@ -308,10 +308,14 @@ | |
| 308 | "Announce", "Send announcements to all subscribers" }, |
| 309 | { 'C', CAPCLASS_FORUM, 0, |
| 310 | "Chat", "Read and/or writes messages in the chatroom" }, |
| 311 | { 'D', CAPCLASS_OTHER, 0, |
| 312 | "Debug", "Enable debugging features" }, |
| 313 | { 'E', CAPCLASS_SUPER, 0, |
| 314 | "Read SyncLog", "Read the SyncLog" }, |
| 315 | { 'F', CAPCLASS_SUPER, 0, |
| 316 | "Update SyncLog", "Add or modify entries in the SyncLog" }, |
| 317 | }; |
| 318 | |
| 319 | /* |
| 320 | ** Populate the aCap[].nUser values based on the current content |
| 321 | ** of the USER table. |
| 322 |
+6
-1
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -1274,11 +1274,12 @@ | ||
| 1274 | 1274 | p->NewTkt = p->Password = p->RdAddr = |
| 1275 | 1275 | p->TktFmt = p->Attach = p->ApndTkt = |
| 1276 | 1276 | p->ModWiki = p->ModTkt = |
| 1277 | 1277 | p->RdForum = p->WrForum = p->ModForum = |
| 1278 | 1278 | p->WrTForum = p->AdminForum = p->Chat = |
| 1279 | - p->EmailAlert = p->Announce = p->Debug = 1; | |
| 1279 | + p->EmailAlert = p->Announce = p->Debug = | |
| 1280 | + p->RdSLog = p->WrSLog = 1; | |
| 1280 | 1281 | /* Fall thru into Read/Write */ |
| 1281 | 1282 | case 'i': p->Read = p->Write = 1; break; |
| 1282 | 1283 | case 'o': p->Read = 1; break; |
| 1283 | 1284 | case 'z': p->Zip = 1; break; |
| 1284 | 1285 | |
| @@ -1312,10 +1313,12 @@ | ||
| 1312 | 1313 | |
| 1313 | 1314 | case '7': p->EmailAlert = 1; break; |
| 1314 | 1315 | case 'A': p->Announce = 1; break; |
| 1315 | 1316 | case 'C': p->Chat = 1; break; |
| 1316 | 1317 | case 'D': p->Debug = 1; break; |
| 1318 | + case 'E': p->RdSLog = 1; break; | |
| 1319 | + case 'F': p->WrSLog = 1; break; | |
| 1317 | 1320 | |
| 1318 | 1321 | /* The "u" privilege recursively |
| 1319 | 1322 | ** inherits all privileges of the user named "reader" */ |
| 1320 | 1323 | case 'u': { |
| 1321 | 1324 | if( p->XReader==0 ){ |
| @@ -1399,10 +1402,12 @@ | ||
| 1399 | 1402 | case '6': rc = p->AdminForum;break; |
| 1400 | 1403 | case '7': rc = p->EmailAlert;break; |
| 1401 | 1404 | case 'A': rc = p->Announce; break; |
| 1402 | 1405 | case 'C': rc = p->Chat; break; |
| 1403 | 1406 | case 'D': rc = p->Debug; break; |
| 1407 | + case 'E': rc = p->RdSLog; break; | |
| 1408 | + case 'F': rc = p->WrSLog; break; | |
| 1404 | 1409 | case 'L': rc = g.zLogin && *g.zLogin; break; |
| 1405 | 1410 | /* Mainenance reminder: '@' should not be used because |
| 1406 | 1411 | it would semantically collide with the @ in the |
| 1407 | 1412 | capexpr TH1 command. */ |
| 1408 | 1413 | default: rc = 0; break; |
| 1409 | 1414 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -1274,11 +1274,12 @@ | |
| 1274 | p->NewTkt = p->Password = p->RdAddr = |
| 1275 | p->TktFmt = p->Attach = p->ApndTkt = |
| 1276 | p->ModWiki = p->ModTkt = |
| 1277 | p->RdForum = p->WrForum = p->ModForum = |
| 1278 | p->WrTForum = p->AdminForum = p->Chat = |
| 1279 | p->EmailAlert = p->Announce = p->Debug = 1; |
| 1280 | /* Fall thru into Read/Write */ |
| 1281 | case 'i': p->Read = p->Write = 1; break; |
| 1282 | case 'o': p->Read = 1; break; |
| 1283 | case 'z': p->Zip = 1; break; |
| 1284 | |
| @@ -1312,10 +1313,12 @@ | |
| 1312 | |
| 1313 | case '7': p->EmailAlert = 1; break; |
| 1314 | case 'A': p->Announce = 1; break; |
| 1315 | case 'C': p->Chat = 1; break; |
| 1316 | case 'D': p->Debug = 1; break; |
| 1317 | |
| 1318 | /* The "u" privilege recursively |
| 1319 | ** inherits all privileges of the user named "reader" */ |
| 1320 | case 'u': { |
| 1321 | if( p->XReader==0 ){ |
| @@ -1399,10 +1402,12 @@ | |
| 1399 | case '6': rc = p->AdminForum;break; |
| 1400 | case '7': rc = p->EmailAlert;break; |
| 1401 | case 'A': rc = p->Announce; break; |
| 1402 | case 'C': rc = p->Chat; break; |
| 1403 | case 'D': rc = p->Debug; break; |
| 1404 | case 'L': rc = g.zLogin && *g.zLogin; break; |
| 1405 | /* Mainenance reminder: '@' should not be used because |
| 1406 | it would semantically collide with the @ in the |
| 1407 | capexpr TH1 command. */ |
| 1408 | default: rc = 0; break; |
| 1409 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -1274,11 +1274,12 @@ | |
| 1274 | p->NewTkt = p->Password = p->RdAddr = |
| 1275 | p->TktFmt = p->Attach = p->ApndTkt = |
| 1276 | p->ModWiki = p->ModTkt = |
| 1277 | p->RdForum = p->WrForum = p->ModForum = |
| 1278 | p->WrTForum = p->AdminForum = p->Chat = |
| 1279 | p->EmailAlert = p->Announce = p->Debug = |
| 1280 | p->RdSLog = p->WrSLog = 1; |
| 1281 | /* Fall thru into Read/Write */ |
| 1282 | case 'i': p->Read = p->Write = 1; break; |
| 1283 | case 'o': p->Read = 1; break; |
| 1284 | case 'z': p->Zip = 1; break; |
| 1285 | |
| @@ -1312,10 +1313,12 @@ | |
| 1313 | |
| 1314 | case '7': p->EmailAlert = 1; break; |
| 1315 | case 'A': p->Announce = 1; break; |
| 1316 | case 'C': p->Chat = 1; break; |
| 1317 | case 'D': p->Debug = 1; break; |
| 1318 | case 'E': p->RdSLog = 1; break; |
| 1319 | case 'F': p->WrSLog = 1; break; |
| 1320 | |
| 1321 | /* The "u" privilege recursively |
| 1322 | ** inherits all privileges of the user named "reader" */ |
| 1323 | case 'u': { |
| 1324 | if( p->XReader==0 ){ |
| @@ -1399,10 +1402,12 @@ | |
| 1402 | case '6': rc = p->AdminForum;break; |
| 1403 | case '7': rc = p->EmailAlert;break; |
| 1404 | case 'A': rc = p->Announce; break; |
| 1405 | case 'C': rc = p->Chat; break; |
| 1406 | case 'D': rc = p->Debug; break; |
| 1407 | case 'E': rc = p->RdSLog; break; |
| 1408 | case 'F': rc = p->WrSLog; break; |
| 1409 | case 'L': rc = g.zLogin && *g.zLogin; break; |
| 1410 | /* Mainenance reminder: '@' should not be used because |
| 1411 | it would semantically collide with the @ in the |
| 1412 | capexpr TH1 command. */ |
| 1413 | default: rc = 0; break; |
| 1414 |
+2
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -109,10 +109,12 @@ | ||
| 109 | 109 | char AdminForum; /* 6: Grant capability 4 to other users */ |
| 110 | 110 | char EmailAlert; /* 7: Sign up for email notifications */ |
| 111 | 111 | char Announce; /* A: Send announcements */ |
| 112 | 112 | char Chat; /* C: read or write the chatroom */ |
| 113 | 113 | char Debug; /* D: show extra Fossil debugging features */ |
| 114 | + char RdSLog; /* E: read the synclog */ | |
| 115 | + char WrSLog; /* F: add to the synclog */ | |
| 114 | 116 | /* These last two are included to block infinite recursion */ |
| 115 | 117 | char XReader; /* u: Inherit all privileges of "reader" */ |
| 116 | 118 | char XDeveloper; /* v: Inherit all privileges of "developer" */ |
| 117 | 119 | }; |
| 118 | 120 | |
| 119 | 121 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -109,10 +109,12 @@ | |
| 109 | char AdminForum; /* 6: Grant capability 4 to other users */ |
| 110 | char EmailAlert; /* 7: Sign up for email notifications */ |
| 111 | char Announce; /* A: Send announcements */ |
| 112 | char Chat; /* C: read or write the chatroom */ |
| 113 | char Debug; /* D: show extra Fossil debugging features */ |
| 114 | /* These last two are included to block infinite recursion */ |
| 115 | char XReader; /* u: Inherit all privileges of "reader" */ |
| 116 | char XDeveloper; /* v: Inherit all privileges of "developer" */ |
| 117 | }; |
| 118 | |
| 119 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -109,10 +109,12 @@ | |
| 109 | char AdminForum; /* 6: Grant capability 4 to other users */ |
| 110 | char EmailAlert; /* 7: Sign up for email notifications */ |
| 111 | char Announce; /* A: Send announcements */ |
| 112 | char Chat; /* C: read or write the chatroom */ |
| 113 | char Debug; /* D: show extra Fossil debugging features */ |
| 114 | char RdSLog; /* E: read the synclog */ |
| 115 | char WrSLog; /* F: add to the synclog */ |
| 116 | /* These last two are included to block infinite recursion */ |
| 117 | char XReader; /* u: Inherit all privileges of "reader" */ |
| 118 | char XDeveloper; /* v: Inherit all privileges of "developer" */ |
| 119 | }; |
| 120 | |
| 121 |
+4
| --- src/setupuser.c | ||
| +++ src/setupuser.c | ||
| @@ -691,10 +691,14 @@ | ||
| 691 | 691 | @ Send Announcements%s(B('A'))</label> |
| 692 | 692 | @ <li><label><input type="checkbox" name="aC"%s(oa['C']) /> |
| 693 | 693 | @ Chatroom%s(B('C'))</label> |
| 694 | 694 | @ <li><label><input type="checkbox" name="aD"%s(oa['D']) /> |
| 695 | 695 | @ Enable Debug%s(B('D'))</label> |
| 696 | + @ <li><label><input type="checkbox" name="aE"%s(oa['E']) /> | |
| 697 | + @ Read SyncLog%s(B('E'))</label> | |
| 698 | + @ <li><label><input type="checkbox" name="aF"%s(oa['F']) /> | |
| 699 | + @ Update SyncLog%s(B('F'))</label> | |
| 696 | 700 | @ </ul></div> |
| 697 | 701 | @ </td> |
| 698 | 702 | @ </tr> |
| 699 | 703 | @ <tr> |
| 700 | 704 | @ <td class="usetupEditLabel">Selected Cap:</td> |
| 701 | 705 |
| --- src/setupuser.c | |
| +++ src/setupuser.c | |
| @@ -691,10 +691,14 @@ | |
| 691 | @ Send Announcements%s(B('A'))</label> |
| 692 | @ <li><label><input type="checkbox" name="aC"%s(oa['C']) /> |
| 693 | @ Chatroom%s(B('C'))</label> |
| 694 | @ <li><label><input type="checkbox" name="aD"%s(oa['D']) /> |
| 695 | @ Enable Debug%s(B('D'))</label> |
| 696 | @ </ul></div> |
| 697 | @ </td> |
| 698 | @ </tr> |
| 699 | @ <tr> |
| 700 | @ <td class="usetupEditLabel">Selected Cap:</td> |
| 701 |
| --- src/setupuser.c | |
| +++ src/setupuser.c | |
| @@ -691,10 +691,14 @@ | |
| 691 | @ Send Announcements%s(B('A'))</label> |
| 692 | @ <li><label><input type="checkbox" name="aC"%s(oa['C']) /> |
| 693 | @ Chatroom%s(B('C'))</label> |
| 694 | @ <li><label><input type="checkbox" name="aD"%s(oa['D']) /> |
| 695 | @ Enable Debug%s(B('D'))</label> |
| 696 | @ <li><label><input type="checkbox" name="aE"%s(oa['E']) /> |
| 697 | @ Read SyncLog%s(B('E'))</label> |
| 698 | @ <li><label><input type="checkbox" name="aF"%s(oa['F']) /> |
| 699 | @ Update SyncLog%s(B('F'))</label> |
| 700 | @ </ul></div> |
| 701 | @ </td> |
| 702 | @ </tr> |
| 703 | @ <tr> |
| 704 | @ <td class="usetupEditLabel">Selected Cap:</td> |
| 705 |