Skip to main content
tor_access
==========

Tornado access lib for user role


## How to collect access node in tornado
```
import tor_access

@tor_access.needcheck(url=True)
class IndexHandler(tornado.web.RequestHandler):
def get(self):
pass



aclgroup = tor_access.ACLGroupNode(u'系统管理', category='category')

@tor_access.needcheck(url=True, group=aclgroup)
class UserHandler(tornado.web.RequestHandler):
def get(self):
pass



@tor_access.needcheck(url=True, category='categroyname')
class UserInfoHandler(tornado.web.RequestHandler):
def get(self):
pass


OR: aclgroup.fetch_handlers(UserHandler,UserInfoHandler) to add access node
```


## How to get access node
```
import tor_access

acl = tor_access.ACL

```

## How to user Role and check access in Handler
```
import tor_access


@tor_access.needcheck(url=True)
class IndexHandler(tornado.web.RequestHandler):
def prepare(self):
mrn = tor_access.MasterRoleNeed() # 超管角色;有所有的权限节点
rn = tor_access.RoleNeed('abcrole',intro=u'普通角色',nodes=set(['restful.index.IndexHandler','userdemo']))
self.check_access(rn)


```

Release files for tor_access 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for tor_access 0.5.2
File Interpreter ABI Platform
tor_access-0.5.2-py2.7.egg Legacy Egg format - - Details

Release files / tor_access-0.5.2-py2.7.egg

Download URL tor_access-0.5.2-py2.7.egg
Size 6.6 kB
Tags Egg
SHA-256 checksum
How to use checksums
56105071b237beb9be57552ed54c76d98812dff153aeb791d5b370ad335ddd7f
BLAKE2b-256 checksum
How to use checksums
b108d42f7b9170a61043d18fdd6bf93afb1b7c6858279d7914e64ea78d2233e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page