[Jifty-commit] r6634 - in jifty/trunk: lib/Jifty
Jifty commits
jifty-commit at lists.jifty.org
Tue Mar 17 14:37:13 EDT 2009
Author: sartak
Date: Tue Mar 17 14:37:12 2009
New Revision: 6634
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/API.pm
Log:
r81315 at onn: sartak | 2009-03-17 14:37:08 -0400
Flip examples around, as little kids know about voting :)
Modified: jifty/trunk/lib/Jifty/API.pm
==============================================================================
--- jifty/trunk/lib/Jifty/API.pm (original)
+++ jifty/trunk/lib/Jifty/API.pm Tue Mar 17 14:37:12 2009
@@ -13,16 +13,16 @@
# Find the full name of an action
my $class = Jifty->api->qualify('SomeAction');
- # Logged users with an ID greater than 10 have restrictions
- if (Jifty->web->current_user->id > 10) {
- Jifty->api->deny('Foo');
- Jifty->api->allow('FooBar');
- Jifty->api->deny('FooBarDeleteTheWorld');
+ # New users cannot run some actions
+ if (Jifty->web->current_user->age < 18) {
+ Jifty->api->deny(qr/Vote|PurchaseTobacco/);
}
- # New users cannot even see some actions
- if (Jifty->web->current_user->age < 18) {
- Jifty->api->hide(qr/Vote|PurchaseTobacco/);
+ # Some users cannot even see some actions
+ if (Jifty->web->current_user->id > 10) {
+ Jifty->api->hide('Foo');
+ Jifty->api->show('FooBar');
+ Jifty->api->hide('FooBarDeleteTheWorld');
}
# Fetch the class names of all actions
More information about the Jifty-commit
mailing list