MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / create_role

Function create_role

web/pgadmin/tools/user_management/__init__.py:353–366  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

351
352
353def create_role(data):
354 try:
355 validate_unique_role(data)
356 r = Role(name=data['name'],
357 description=data['description'])
358 db.session.add(r)
359 db.session.commit()
360 return ajax_response(
361 status=200
362 )
363 except Exception as e:
364 db.session.rollback()
365 current_app.logger.exception(e)
366 return internal_server_error(str(e))
367
368
369def update_role(rid, data):

Callers 1

role_saveFunction · 0.70

Calls 4

RoleClass · 0.90
internal_server_errorFunction · 0.90
validate_unique_roleFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected