Comments (7)
is this really business specific as mentioned in #245? redirects for permissions... maybe, but having world readable but not writable pages seems like a pretty standard thing to me
from gae-init.
i like it too
from gae-init.
+1
i don't think the use case would be business specific. rewriting the decorators to support args can help us build a more specific use case endpoints.
from gae-init.
+1
from gae-init.
What's an example of an argument you'd want to pass in? I want to better understand this.
You do know you can utilize variables in your route's inside the decorator, as-is, right? And that won't do the trick?
Here's an example decorator - where I am pulling the 'account_id' from the route and using it in the decorator:
def account_required(f):
def account_decorator(f):
decorator_order_guard(f, 'auth.account_required')
@functools.wraps(f)
def decorated_function(*args, **kws):
account_id = kws['account_id']
if current_user_account() == account_id:
return f(*args, **kws)
return flask.redirect(flask.url_for('account_list'))
return decorated_function
from gae-init.
Just to add my 3.14 cents here, although kind of late, but just in case anyone stumbles on it. I am using mr. norton's approach looking in the request like
if 'my_variable' in kws: do_stuff()
For handling logic I would suggest to use the API
section where you can actually decorate the methods you desire. Use control/
only for server side rendering.
from gae-init.
I'll pass on this one.. Also @topless idea could work :)
from gae-init.
Related Issues (20)
- Google login is not working (not GAE) HOT 1
- AttributeError: 'module' object has no attribute 'get_dbs'
- gulp-help is a blocker to upgrading to gulp4 HOT 2
- Yarn doesn't work with Node v12 HOT 3
- Use of memcache is a blocker to Python 3.7 migration HOT 5
- Trouble running gulp for local testing with grpcio in app.yaml HOT 4
- Can't import numpy HOT 7
- Error with virtualenv unrecognized argument during yarn install
- Requirement for email_validator on local test run not satisfied? HOT 4
- Race condition in deploy vs creation of lib.zip HOT 2
- Inconsistencies in gulpfile task descriptions HOT 3
- Add Twitch Login
- Upgrade to Font Awesome 5
- plan to update to python 3? HOT 1
- Moment.js is a legacy project HOT 1
- Dependabot couldn't authenticate with https://pypi.python.org/simple/
- Import error with latest changes HOT 1
- Travis not running
- Improve cleanup in development HOT 1
- gae-init.appspot.com is down
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gae-init.