我正在寻找一个基于角色的框架/模块/包,用于在Google App Engine上运行的Python(2.7)编写的应用程序.
基于角色的意思是一种机制,允许我检查(在大多数时间的请求处理期间)某个用户是否能够执行特定操作.
一对用例:
我在想象类似的东西
user_a.is_able_to('read', user_b) # -> True of False
Run Code Online (Sandbox Code Playgroud)
要么
user_a.authorize('update', user_b) # raises an exception if 'not allowed to'
Run Code Online (Sandbox Code Playgroud)
到目前为止,我只是从tipfy 看到了acl.py.看起来很简单,非常接近我正在寻找的东西.我想知道是否有类似于acl.py的东西,最好用NDB实现.
在我的网络应用中,用户可以发布博客文章.当我显示博客文章时,不显示换行符,因为我没有用<br>
标签替换新行.问题是我在Jinja中启用了autoescaping,因此<br>
标签被转义.我不想暂时禁用autoescaping,我想特别允许<br>
标签.我该怎么做?
如何删除GWT中的ClickHandler事件?我为一个按钮添加了addClickHandler()事件,我想删除ClickHandler Event.I尝试了HandlerRegistration方法但是它无法删除处理程序,这是一个片段:
notification.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
// TODO Auto-generated method stub
}
});
Run Code Online (Sandbox Code Playgroud)
我想通知删除处理程序!
Note:
Notification is the button instance that calls the handler!
Run Code Online (Sandbox Code Playgroud)