[Bps-public-commit] App-Changeloggr branch, master, updated. 627780c343851c69d5356ab817d2bef6a2d007f8

Alex M Vandiver alexmv at bestpractical.com
Wed May 20 17:14:03 EDT 2009


The branch, master has been updated
       via  627780c343851c69d5356ab817d2bef6a2d007f8 (commit)
      from  57a83f87f575e76e33b9d18cfe7ae6f5be880a38 (commit)

Summary of changes:
 etc/config.yml                         |    2 +-
 lib/App/Changeloggr/Model/Changelog.pm |    6 ++++++
 lib/App/Changeloggr/View.pm            |    2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 627780c343851c69d5356ab817d2bef6a2d007f8
Author: Alex Vandiver <alexmv at mit.edu>
Date:   Wed May 20 17:13:42 2009 -0400

    Add concept of "owners" for changelogs

diff --git a/etc/config.yml b/etc/config.yml
index 3e83ba1..dfbc8f4 100644
--- a/etc/config.yml
+++ b/etc/config.yml
@@ -14,7 +14,7 @@ framework:
     Password: ''
     RecordBaseClass: Jifty::DBI::Record::Cachable
     User: ''
-    Version: 0.0.12
+    Version: 0.0.13
   DevelMode: 1
   L10N: 
     PoDir: share/po
diff --git a/lib/App/Changeloggr/Model/Changelog.pm b/lib/App/Changeloggr/Model/Changelog.pm
index 287bcb4..0d5b0ea 100644
--- a/lib/App/Changeloggr/Model/Changelog.pm
+++ b/lib/App/Changeloggr/Model/Changelog.pm
@@ -5,6 +5,12 @@ package App::Changeloggr::Model::Changelog;
 use Jifty::DBI::Schema;
 
 use App::Changeloggr::Record schema {
+    column owner =>
+        refers_to App::Changeloggr::Model::User,
+        default is defer { Jifty->web->current_user->id },
+        is protected,
+        since '0.0.13';
+
     column name =>
         type is 'text',
         label is 'Project name',
diff --git a/lib/App/Changeloggr/View.pm b/lib/App/Changeloggr/View.pm
index 9a75aad..d3f5e6d 100644
--- a/lib/App/Changeloggr/View.pm
+++ b/lib/App/Changeloggr/View.pm
@@ -77,7 +77,7 @@ sub changelog_summary {
         label => $changelog->name,
     );
 
-    if (Jifty->config->framework('DevelMode')) {
+    if (Jifty->config->framework('DevelMode') or Jifty->web->current_user->id == $changelog->owner->id) {
         span {};
         my $admin_token = $changelog->as_superuser->admin_token;
         hyperlink(

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list