[Bps-public-commit] App-Changeloggr branch, master, updated. ee6405168300ebc3ca3ad7c24185eb53f1d5356a
sartak at bestpractical.com
sartak at bestpractical.com
Wed May 20 18:48:31 EDT 2009
The branch, master has been updated
via ee6405168300ebc3ca3ad7c24185eb53f1d5356a (commit)
from 5c012bdfca2bc9df56bcf6b685a6b55f372c3713 (commit)
Summary of changes:
etc/config.yml | 2 +-
lib/App/Changeloggr/Model/ChangelogAdmin.pm | 29 +++++++++++++++++++++++++++
2 files changed, 30 insertions(+), 1 deletions(-)
create mode 100644 lib/App/Changeloggr/Model/ChangelogAdmin.pm
- Log -----------------------------------------------------------------
commit ee6405168300ebc3ca3ad7c24185eb53f1d5356a
Author: Shawn M Moore <sartak at gmail.com>
Date: Wed May 20 18:48:05 2009 -0400
Add a ChangelogAdmin model
diff --git a/etc/config.yml b/etc/config.yml
index dfbc8f4..31248b4 100644
--- a/etc/config.yml
+++ b/etc/config.yml
@@ -14,7 +14,7 @@ framework:
Password: ''
RecordBaseClass: Jifty::DBI::Record::Cachable
User: ''
- Version: 0.0.13
+ Version: 0.0.14
DevelMode: 1
L10N:
PoDir: share/po
diff --git a/lib/App/Changeloggr/Model/ChangelogAdmin.pm b/lib/App/Changeloggr/Model/ChangelogAdmin.pm
new file mode 100644
index 0000000..6c46a16
--- /dev/null
+++ b/lib/App/Changeloggr/Model/ChangelogAdmin.pm
@@ -0,0 +1,29 @@
+use strict;
+use warnings;
+
+package App::Changeloggr::Model::ChangelogAdmin;
+use Jifty::DBI::Schema;
+use Scalar::Defer 'defer';
+
+use App::Changeloggr::Record schema {
+ column changelog_id =>
+ refers_to App::Changeloggr::Model::Changelog,
+ is mandatory,
+ is immutable;
+
+ column user_id =>
+ refers_to App::Changeloggr::Model::User,
+ is mandatory,
+ is immutable,
+ default is defer { Jifty->web->current_user->user_object };
+};
+
+sub since { '0.0.14' }
+
+sub current_user_can {
+ my $self = shift;
+
+ # Only superuser can CRUD these records
+ return $self->current_user->is_superuser;
+}
+
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list