~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/apps/fileservice/listing.py

  • Committer: mattgiuca
  • Date: 2008-01-22 23:41:29 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:267
Changed semantics of "published" property: Now applies to directories, not
files, and causes everything in the directory to get published.

fileservice: Listing only shows "published" for directories.
studpath.authorized_public: Checks parent directory for publish permission
    instead of the file itself.

(This comes out of a series of meetings with Tom and Steven, where we decided
that file-level access is too fine grained; you can't control user-generated
files).

Show diffs side-by-side

added added

removed removed

Lines of Context:
254
254
        if stat.S_ISDIR(file_stat.st_mode):
255
255
            d["isdir"] = True
256
256
            d["type_nice"] = util.nice_filetype("/")
 
257
            # Only directories can be published
 
258
            d["published"] = studpath.published(fullpath)
257
259
        else:
258
260
            d["isdir"] = False
259
261
            d["size"] = file_stat.st_size
265
267
        d["mtime"] = file_stat.st_mtime
266
268
        d["mtime_nice"] = make_date_nice(file_stat.st_mtime)
267
269
        d["mtime_short"] = make_date_nice_short(file_stat.st_mtime)
268
 
        d["published"] = studpath.published(fullpath)
269
270
    except OSError:
270
271
        # Here if, eg, the file is missing.
271
272
        # Can't get any more information so just return d