Skip to main content

maxwin permission

Project description

``
python setup.py sdist
``
###产生分发包
``
python setup.py build
``

###安装方式

1. pip install dist\\mwpermission-0.1.0.zip
2. python setup.py install

### 权限检查
##### 1. 创建
```
from mwpermission.permission import Permission

app = Flask(__name__)
# 设定permission_url 来访问权限资料,推荐在开发模式下使用
app.config['PERMISSION_URL']='http://192.168.101.129:8999/rightmanage/v1.0/permissions?systemname=maxguideweb'
# 没有设定PERMISSION_URL 时,系统使用PERMISSION_ROOT_URL 来自动产生PERMISSION_URL
# permission_url = '%srightmng/%s/permissions?systemname=%s'%(self.permission_root_url,self.version,self.sys)
#app.config['PERMISSION_ROOT_URL'] = '../../'

p = Permission('maxguideweb')
...
p.init_app(app)
...
```
##### 2. 调用权限检查
```
from app import p

# 检查vehicle 是否有 insert,edit的权限
@p.check('vehicle',['insert','edit'])
def vehicle():
return 'test for insert/edit vehicle'
```


Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Description-Content-Type: text/markdown

Project details


Release history Release notifications

This version
History Node

0.1.18

History Node

0.1.17

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
mwpermission-0.1.18.tar.gz (3.5 kB) Copy SHA256 hash SHA256 Source None May 7, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page