Fossil SCM

Add the "E" and "F" capability letters to control reading and writing to the synclog.

drh 2021-12-19 18:10 synclog
Commit 06b3ace4ce190c5f7d95e0b5a220eafca1d5e1559d834073324dce892b8afe26
--- src/capabilities.c
+++ src/capabilities.c
@@ -100,11 +100,11 @@
100100
void capability_expand(CapabilityString *pIn){
101101
static char *zNobody = 0;
102102
static char *zAnon = 0;
103103
static char *zReader = 0;
104104
static char *zDev = 0;
105
- static char *zAdmin = "bcdefghijklmnopqrtwz234567AD";
105
+ static char *zAdmin = "bcdefghijklmnopqrtwz234567ADEF";
106106
int doneV = 0;
107107
108108
if( pIn==0 ){
109109
fossil_free(zNobody); zNobody = 0;
110110
fossil_free(zAnon); zAnon = 0;
@@ -308,10 +308,14 @@
308308
"Announce", "Send announcements to all subscribers" },
309309
{ 'C', CAPCLASS_FORUM, 0,
310310
"Chat", "Read and/or writes messages in the chatroom" },
311311
{ 'D', CAPCLASS_OTHER, 0,
312312
"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" },
313317
};
314318
315319
/*
316320
** Populate the aCap[].nUser values based on the current content
317321
** of the USER table.
318322
--- 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 @@
12741274
p->NewTkt = p->Password = p->RdAddr =
12751275
p->TktFmt = p->Attach = p->ApndTkt =
12761276
p->ModWiki = p->ModTkt =
12771277
p->RdForum = p->WrForum = p->ModForum =
12781278
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;
12801281
/* Fall thru into Read/Write */
12811282
case 'i': p->Read = p->Write = 1; break;
12821283
case 'o': p->Read = 1; break;
12831284
case 'z': p->Zip = 1; break;
12841285
@@ -1312,10 +1313,12 @@
13121313
13131314
case '7': p->EmailAlert = 1; break;
13141315
case 'A': p->Announce = 1; break;
13151316
case 'C': p->Chat = 1; break;
13161317
case 'D': p->Debug = 1; break;
1318
+ case 'E': p->RdSLog = 1; break;
1319
+ case 'F': p->WrSLog = 1; break;
13171320
13181321
/* The "u" privilege recursively
13191322
** inherits all privileges of the user named "reader" */
13201323
case 'u': {
13211324
if( p->XReader==0 ){
@@ -1399,10 +1402,12 @@
13991402
case '6': rc = p->AdminForum;break;
14001403
case '7': rc = p->EmailAlert;break;
14011404
case 'A': rc = p->Announce; break;
14021405
case 'C': rc = p->Chat; break;
14031406
case 'D': rc = p->Debug; break;
1407
+ case 'E': rc = p->RdSLog; break;
1408
+ case 'F': rc = p->WrSLog; break;
14041409
case 'L': rc = g.zLogin && *g.zLogin; break;
14051410
/* Mainenance reminder: '@' should not be used because
14061411
it would semantically collide with the @ in the
14071412
capexpr TH1 command. */
14081413
default: rc = 0; break;
14091414
--- 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 @@
109109
char AdminForum; /* 6: Grant capability 4 to other users */
110110
char EmailAlert; /* 7: Sign up for email notifications */
111111
char Announce; /* A: Send announcements */
112112
char Chat; /* C: read or write the chatroom */
113113
char Debug; /* D: show extra Fossil debugging features */
114
+ char RdSLog; /* E: read the synclog */
115
+ char WrSLog; /* F: add to the synclog */
114116
/* These last two are included to block infinite recursion */
115117
char XReader; /* u: Inherit all privileges of "reader" */
116118
char XDeveloper; /* v: Inherit all privileges of "developer" */
117119
};
118120
119121
--- 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
--- src/setupuser.c
+++ src/setupuser.c
@@ -691,10 +691,14 @@
691691
@ Send Announcements%s(B('A'))</label>
692692
@ <li><label><input type="checkbox" name="aC"%s(oa['C']) />
693693
@ Chatroom%s(B('C'))</label>
694694
@ <li><label><input type="checkbox" name="aD"%s(oa['D']) />
695695
@ 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>
696700
@ </ul></div>
697701
@ </td>
698702
@ </tr>
699703
@ <tr>
700704
@ <td class="usetupEditLabel">Selected Cap:</td>
701705
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button