Fossil

Check-in [b3a346e0e6]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Allow non-privileged users to see phantom artifacts in /bloblist. Private artifacts may still only be seen by high-privilege users. If an artifact is both private and a phantom, it is viewable because "private" in the context of a phantom is different from a real private artifact.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b3a346e0e621173a3e7aae15ea5d5418be2b11afcdb64021e3778eb280e7a972
User & Date: drh 2020-04-13 20:16:30.913
Context
2020-04-13
23:43
Initial draft of the "hints for git users" document. check-in: 8389757aa8 user: drh tags: trunk
20:16
Allow non-privileged users to see phantom artifacts in /bloblist. Private artifacts may still only be seen by high-privilege users. If an artifact is both private and a phantom, it is viewable because "private" in the context of a phantom is different from a real private artifact. check-in: b3a346e0e6 user: drh tags: trunk
18:28
Enhance the artifact description logic to try to determine the source of phantom artifacts. check-in: 7fd31f6957 user: drh tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/name.c.
1224
1225
1226
1227
1228
1229
1230

1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243

  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
  style_header("List Of Artifacts");
  style_submenu_element("250 Largest", "bigbloblist");
  if( g.perm.Admin ){
    style_submenu_element("Artifact Log", "rcvfromlist");

    if( !phantomOnly ){
      style_submenu_element("Phantoms", "bloblist?phan");
    }
  }else{
    privOnly = 0;
    phantomOnly = 0;
  }
  if( g.perm.Private || g.perm.Admin ){
    if( !privOnly ){
      style_submenu_element("Private", "bloblist?priv");
    }
  }else{
    privOnly = 0;







>
|
|
<
<
<
<







1224
1225
1226
1227
1228
1229
1230
1231
1232
1233




1234
1235
1236
1237
1238
1239
1240

  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
  style_header("List Of Artifacts");
  style_submenu_element("250 Largest", "bigbloblist");
  if( g.perm.Admin ){
    style_submenu_element("Artifact Log", "rcvfromlist");
  }
  if( !phantomOnly ){
    style_submenu_element("Phantoms", "bloblist?phan");




  }
  if( g.perm.Private || g.perm.Admin ){
    if( !privOnly ){
      style_submenu_element("Private", "bloblist?priv");
    }
  }else{
    privOnly = 0;
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
  while( db_step(&q)==SQLITE_ROW ){
    int rid = db_column_int(&q,0);
    const char *zUuid = db_column_text(&q, 1);
    const char *zDesc = db_column_text(&q, 2);
    int isPriv = db_column_int(&q,3);
    int isPhantom = db_column_int(&q,4);
    const char *zRef = db_column_text(&q,6);
    if( isPhantom && !g.perm.Admin ){
      /* Do not show phantom artifacts to non-admin users */
      continue;
    }
    if( isPriv && !g.perm.Private && !g.perm.Admin ){
      /* Don't show private artifacts to users without Private (x) permission */
      continue;
    }
    if( hashClr ){
      const char *zClr = db_column_bytes(&q,1)>40 ? zSha3Bg : zSha1Bg;
      @ <tr style='background-color:%s(zClr);'><td align="right">%d(rid)</td>
    }else{







<
<
<
<
|







1286
1287
1288
1289
1290
1291
1292




1293
1294
1295
1296
1297
1298
1299
1300
  while( db_step(&q)==SQLITE_ROW ){
    int rid = db_column_int(&q,0);
    const char *zUuid = db_column_text(&q, 1);
    const char *zDesc = db_column_text(&q, 2);
    int isPriv = db_column_int(&q,3);
    int isPhantom = db_column_int(&q,4);
    const char *zRef = db_column_text(&q,6);




    if( isPriv && !isPhantom && !g.perm.Private && !g.perm.Admin ){
      /* Don't show private artifacts to users without Private (x) permission */
      continue;
    }
    if( hashClr ){
      const char *zClr = db_column_bytes(&q,1)>40 ? zSha3Bg : zSha1Bg;
      @ <tr style='background-color:%s(zClr);'><td align="right">%d(rid)</td>
    }else{