Commit d26b4563 authored by Vojtech Sodoma's avatar Vojtech Sodoma

Merge branch '3458-labels-retrieve-acl-based-on-webi-user-permission' into 'master'

3458 labels retrieve acl based on webi user permission

See merge request !70
parents be467410 df939470
xivo-dao (2020.16.00) xivo-freya; urgency=medium
* 3458 - retrieve confd acl based on webi user permission
-- Etienne Allovon <[email protected]> Mon, 31 Aug 2020 09:36:45 +0000
xivo-dao (2020.15.00) xivo-freya; urgency=medium
* 3412 Add a user to an existing label (API)
......
......@@ -34,3 +34,9 @@ def check_username_password(session, username, password):
def get_admin_id(session, username):
return session.query(User.id).filter(and_(User.login == username,
User.valid == 1)).scalar()
@daosession
def get_admin_permission(session, username):
return session.query(User.obj).filter(and_(User.login == username,
User.valid == 1)).scalar()
\ No newline at end of file
......@@ -57,3 +57,11 @@ class TestAdminUserDAO(DAOTestCase):
result = admin_dao.get_admin_id('foo')
assert_that(result, equal_to(admin.id))
def test_get_admin_permission(self):
acl = 'a:1:{s:3:"acl";a:1:{s:7:"service";a:1:{s:4:"ipbx";a:1:{s:12:"pbx_settings";a:1:{s:5:"users";b:1;}}}}}'
_ = self.add_admin(login='foo', obj=acl)
result = admin_dao.get_admin_permission('foo')
assert_that(result, equal_to(acl))
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment