Change Password

Input error
Input error
Input error
Submit

Change Nickname

Current Nickname:
Submit
v4.0

User and Privilege

Privilege and Policy

  • List Privilege

    The Connection object provides method showPrivilege to list all privileges.

    from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.showPrivilege()
    print(ret.toJSON())
    
  • List Policy

    The Connection object provides method showPolicy to list all policies.

    from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.showPolicy()
    print(ret.toJSON())
    
  • Get Policy Detail

    The Connection object provides method getPolicy to display a certain policy's detail.

    from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.getPolicy(ULTIPA_REQUEST.GetPolicy("test"))
    print(ret.toJSON())
    
  • Create Policy

    The Connection object provides method createPolicy to create policy.

    from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
    from ultipa.utils.privileges import GraphPrivileges, SystemPrivileges
    conn = Connection(host='host:port', username="root", password="root")
    ret  = conn.createPolicy(ULTIPA_REQUEST.CreatePolicy(name="sales",
      		graphPrivileges={"default":[GraphPrivileges.FIND]},
      		systemPrivileges=[SystemPrivileges.CREATE_POLICY])) 
    print(ret.toJSON())
    
  • Alter Policy

    The Connection object provides method alterPolicy to update a certain policy.

    from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
    from ultipa.utils.privileges import GraphPrivileges, SystemPrivileges
    conn = Connection(host='host:port', username="root", password="root")
    ret  = conn.alterPolicy(ULTIPA_REQUEST.AlterPolicy(name='sales',
      		graphPrivileges={"default":[GraphPrivileges.AB, GraphPrivileges.FIND]},
      		systemPrivileges=[SystemPrivileges.CREATE_POLICY]))
    print(ret.toJSON())
    
  • Drop Policy

    The Connection object provides method dropPolicy to delete a certain policy.

    from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
    from ultipa.utils.privileges import GraphPrivileges, SystemPrivileges
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.dropPolicy(ULTIPA_REQUEST.DropPolicy(name="sales"))
    print(ret.toJSON())
    
  • Grant

    The Connection object provides method grantPolicy to grant priviledges and policies to a certain user.

    from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
    from ultipa.utils.privileges import GraphPrivileges, SystemPrivileges
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.grantPolicy(ULTIPA_REQUEST.GrantPolicy(username='ultipa',
      		graphPrivileges={'default':[GraphPrivileges.LTE]}, policies=['sales']))
    print(ret.toJSON())
    
  • Revoke

    The Connection object provides method revokePolicy to revoke priviledges and policies from a certain user.

    from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
    from ultipa.utils.privileges import GraphPrivileges, SystemPrivileges
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.revokePolicy(ULTIPA_REQUEST.RevokePolicy(username='ultipa', 
      		graphPrivileges={'*':[GraphPrivileges.LTE], 
      		systemPrivileges=[SystemPrivileges.CREATE_POLICY]}))
    print(ret.toJSON())
    

User Management

  • Get User Detail

    The Connection object provides method getUser to display a certain user's detail.

    from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
    from ultipa.utils.privileges import GraphPrivileges, SystemPrivileges
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.getUser(ULTIPA_REQUEST.GetUser(username='ultipa'))
    print(ret.toJSON())
    
  • Create User

    The Connection object provides method createUser to create user.

    from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
    from ultipa.utils.privileges import GraphPrivileges, SystemPrivileges
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.createUser(ULTIPA_REQUEST.CreateUser(username="ultipa", password="123456",
    			graphPrivileges={'default':[GraphPrivileges.LTE]},
    			systemPrivileges=[SystemPrivileges.SHOW_GRAPH], policies=['sales']))
    print(ret.toJSON())
    
  • Alter User

    The Connection object provides method alterUser to update a certain user.

    from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
    from ultipa.utils.privileges import GraphPrivileges, SystemPrivileges
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.alterUser(ULTIPA_REQUEST.AlterUser(username='ultipa', 
      		graph_privileges={"*": [GraphPrivileges.UFE]}))
    print(ret.toJSON())
    
  • Drop User

    The Connection object provides method dropUser to delete a certain user.

    from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.dropUser(ULTIPA_REQUEST.DropUser(username='ultipa'))
    print(ret.toJSON())
    
Please complete the following information to download this book
*
公司名称不能为空
*
公司邮箱必须填写
*
你的名字必须填写
*
你的电话必须填写
*
你的电话必须填写