Skip to main content

User role access for tornado

Project description

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('userdemo',u'系统管理')

@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



```


## 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)


```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tor_access-0.2.1.dev.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tor_access-0.2.1.dev-py2.7.egg (5.2 kB view details)

Uploaded Egg

File details

Details for the file tor_access-0.2.1.dev.tar.gz.

File metadata

File hashes

Hashes for tor_access-0.2.1.dev.tar.gz
Algorithm Hash digest
SHA256 cd44f6b11b667b32f975c8aa2bd723648cec288d7c0b5cd48555376db949e62c
MD5 8c135182e1889e38f741dbb16f58daf3
BLAKE2b-256 2552703ced364a55aa4aa9976b767413f945ec5d383eaa64f57dd4d2926fbbaa

See more details on using hashes here.

File details

Details for the file tor_access-0.2.1.dev-py2.7.egg.

File metadata

File hashes

Hashes for tor_access-0.2.1.dev-py2.7.egg
Algorithm Hash digest
SHA256 2e7e16b26fa6f30b84cae8e1ec6b5120ffd1fcee51888128715345f6ede2fee0
MD5 b75b8cc91df8f3c4976004007aa01030
BLAKE2b-256 5e8d35f23cab0b9be126f21cc1a6a8a2b7aa6c9865cd5faccce6a8b9ab9beeb7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page