2
只是想确认Nitrogen Authentication and Authorization API的用法。该API的描述是:Nitrogen Auth API的正确用法是什么?
wf:user() -> User or 'undefined'
Return the user value that was previously set by wf:user(User)
wf:user(User) -> ok
Set the user for the current session.
wf:clear_user() -> ok
Same as wf:user(undefined).
wf:role(Role) -> 'true' or 'false'
Check if the current user has a specified role.
wf:role(Role, IsInRole) -> ok
Set whether the current user is in a specified role.
wf:clear_roles() -> ok
Remove the user from all roles.
要使用此API我会先验证对我的数据库用户登录存储的凭据,然后设置WF:用户(用户)的成功验证的用户?然后,我可以执行诸如检查undefined = wf:user()
是否确认用户已通过身份验证以保护受限制的页面?同样,我会为用户设置角色等,然后我可以对角色执行验证。氮在背景中以某种方式将这些信息存储在背景中?
好的,谢谢你的信息。 – 2009-12-28 18:49:40
知道任何好的氮气doc /教程? nitrogenproject.com上的文档是可以的,但要详细。 – 2009-12-28 18:54:10
我有几个我写的,你可以在这里找到:http://jeremy.marzhillstudios.com/index.php/tag/nitrogen/ 除了氮工程的演示和文档是唯一的东西我真的知道。 – 2009-12-28 23:20:26