Beispiel #1
0
 def create_perm(self, role, scopes=None):
     data = {
         'match': role,
         'scopes': scopes or list()
     }
     r = self.http.post('/perm', data)
     return Permission.parse(r['permission'])
Beispiel #2
0
 def update_perm(self, id, **kwargs):
     data = {
         'match': kwargs.get('match'),  # role
         'scopes': kwargs.get('scopes')
     }
     r = self.http.put('/perm/{}'.format(id), data)
     return Permission.parse(r['permission'])
Beispiel #3
0
 def create_perm(self, role, scopes=None):
     data = {
         'match': role,
         'scopes': scopes or list()
     }
     r = self.http.post('/perm', data)
     return Permission.parse(r['permission'])
 def get_perms(self, query=None):
     r = self.http.get('/perms', query)
     return [Permission.parse(p) for p in r['permissions']]
Beispiel #5
0
 def get_user(self):
     return Permission.parse(self.http.get('/user/%s' % id)['user'])
Beispiel #6
0
 def get_perms(self, query=None):
     r = self.http.get('/perms', query)
     return [Permission.parse(p) for p in r['permissions']]
Beispiel #7
0
 def get_perm(self):
     return Permission.parse(self.http.get('/perm/%s' % id)['perm'])
Beispiel #8
0
 def get_user(self):
     return Permission.parse(self.http.get('/user/%s' % id)['user'])
Beispiel #9
0
 def get_perm(self):
     return Permission.parse(self.http.get('/perm/%s' % id)['perm'])