summaryrefslogtreecommitdiff
path: root/indoteknik_api/controllers/api_v1/user.py
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_api/controllers/api_v1/user.py')
-rw-r--r--indoteknik_api/controllers/api_v1/user.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/indoteknik_api/controllers/api_v1/user.py b/indoteknik_api/controllers/api_v1/user.py
index 848575e2..56b037a1 100644
--- a/indoteknik_api/controllers/api_v1/user.py
+++ b/indoteknik_api/controllers/api_v1/user.py
@@ -42,9 +42,17 @@ class User(controller.Controller):
uid = request.session.authenticate(
config.get('db_name'), email, password)
user = request.env['res.users'].browse(uid)
+ role = []
+ if user.is_inbound and user.is_outbound:
+ role.append('admin')
+ elif user.is_outbound:
+ role.append('outbound')
+ elif user.is_inbound:
+ role.append('inbound')
data = {
'is_auth': True,
- 'user': self.response_with_token(user)
+ 'role': role,
+ 'user': self.response_with_token(user),
}
return self.response(data)
except: