| 23 | | return result |
|---|
| 24 | | |
|---|
| 25 | | |
|---|
| 26 | | @jsonify.when('isinstance(obj, Extent) and obj.name == "IdentityGroup"') |
|---|
| 27 | | def jsonify_group(obj): |
|---|
| 28 | | result = jsonify_schevo(obj) |
|---|
| 29 | | result['users'] = jsonify([user.name for user in obj.x.users()]) |
|---|
| 30 | | result['permissions'] = jsonify([ |
|---|
| 31 | | perm.name for perm in obj.x.permissions()]) |
|---|
| 32 | | return result |
|---|
| 33 | | |
|---|
| 34 | | |
|---|
| 35 | | @jsonify.when('isinstance(obj, Extent) and obj.name == "IdentityPermission"') |
|---|
| 36 | | def jsonify_permission(obj): |
|---|
| 37 | | result = jsonify_schevo(obj) |
|---|
| 38 | | result['groups'] = jsonify([group.name for group in obj.x.groups()]) |
|---|
| 39 | | return result |
|---|
| 40 | | |
|---|
| 41 | | |
|---|
| 42 | | @jsonify.when('isinstance(obj, Extent) and obj.name == "IdentityUser"') |
|---|
| 43 | | def jsonify_user(obj): |
|---|
| 44 | | result = jsonify_schevo(obj) |
|---|
| 45 | | del result['password'] |
|---|
| 46 | | result['groups'] = jsonify([group.name for group in obj.x.groups()]) |
|---|
| 47 | | result['permissions'] = jsonify([ |
|---|
| 48 | | perm.name for perm in obj.x.permissions()]) |
|---|