阅 读 文 章

snakelets 文档,我翻译了一部分。

[来源:网上转载 (http://www.chinaunix.net) | 作者:网友(瘦青蛙) | 时间:2007-05-27 | 浏览:人次 ]



def documentAllower(path): ... define this function to allow serving the given document (regardless of user authorization). Return True if allowed. By default, all documents are allowed except Python source files (.py suffix). Path is relative for the web app, for instance "img/picture.gif"
定义此函数来提供文档服务(忽略用户授权)。如果允许返回True。默认情况除了python源文件(.py后缀)以外所有文档都可以访问。采用相对路径。比如: ‘img/picture.gif’。

authorizationPatterns a dict that maps (relative) URL patterns to lists of privilege names that are allowed to access those URLs. Note that the full URL must match the pattern before authorization is required, so Snakelets automatically appends the *-wildcard to the end of your pattern to avoid security holes. (Also: the server-wide url prefix is automatically prepended to your patterns) See authorization. Default: all URLs are allowed (no privilege checks).
允许访问特有名称列表的映射URL标记。注意 在授权请求之前完整URL必须匹配标记,Snakelets自动在您的标记后面添加*-wildcard来避免安全漏洞。(同样:server-wide url前缀将被预先自动添加到你的标记前)见 authorization 。默认:所有URL都是允许的(没有特权检测)。

authenticationMethod tuple (method, argument) that defines the user authentication method to use for the whole webapp. See authorization. Default: not specified. This setting can be overruled by a corresponding page declaration or snakelet method. 
为整个webapp定义用户验证。见 authorization 。 默认:无指定。这个设置可以被相应的页面或者snakelet 方法修改。

def authorizeUser(method, url, user, passwd, request): ... You must implement this method yourself if you let Snakelets do the user authentication. It must do the actual user/password checking, see authorization.
如果您让Snakelets进行用户验证,您必须自己实现该方法。必须有 user/password 检测,见 authorization 。

def init(webapp): ... You may define this function to do your webapp's initialization. Parameter is the current webapp. Note: when you are deploying your webapp on multiple vhosts, the init is called once for each vhost! Be prepared for this, especially when you are doing system-global initialisation code such as registering server plugins... (you should trap possible errors, or add some code that makes sure that such things are only done once)
论坛热门帖子: [lch203] 写得蛮好的linux学习笔记(10-21)
[黑马制造] 学习java的30个目标(10-19)
[笑傲股林] 做测试半年了,有点迷茫,应该再学些什么提高自己的测试水平和测试能力呢?(10-19)
[udp8589] 大家用google的来吱一声? 用百度的~~也来报道下?(10-18)
[沂偌掳兆] 本人总结的一些认为C++比较经典的书籍,希望对大家有用(10-18)
TAG标签: 翻译 文档 使用 可以 页面 URL 如果 文件 webapp 一个

最新评论 共有1位网友发表了评论

发表评论

评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名:(注册)
密码:
验证码:
匿名发表

网站地图友情连接交流论坛网站投稿广告服务联系我们留言本站长统计
Some rights reserved: www.chmhome.com, 鄂ICP备07010232号 E-mail:chinakafei@live.com,QQ:552766
中国咖啡技术网(Chmhome):国外编程技术书籍,中文编程手册,经典编程文章,交流技术,技术软件下载,计算机论文,毕业论文.