修改密码

请输入密码
请输入密码 请输入8-64长度密码 和 email 地址不相同 至少包括数字、大写字母、小写字母、半角符号中的 3 个
请输入密码
提交

修改昵称

当前昵称:
提交

申请证书

证书详情

Please complete this required field.

  • Ultipa Graph V4

Standalone

Please complete this required field.

Please complete this required field.

服务器的MAC地址

Please complete this required field.

Please complete this required field.

取消
申请
ID
产品
状态
核数
申请天数
审批时间
过期时间
MAC地址
申请理由
审核信息
关闭
基础信息
  • 用户昵称:
  • 手机号:
  • 公司名称:
  • 公司邮箱:
  • 地区:
  • 语言:
修改密码
申请证书

当前未申请证书.

申请证书
Certificate Issued at Valid until Serial No. File
Serial No. Valid until File

Not having one? Apply now! >>>

ProductName CreateTime ID Price File
ProductName CreateTime ID Price File

No Invoice

搜索
    中文

      用户

      概述

      嬴图数据库的用户(User)可拥有多个权限和策略,以便对嬴图数据库进行操作。

      用户命名规则

      创建用户时需设置用户名,规则如下:

      • 2~64个字符
      • 以字母开头
      • 仅允许使用字母、下划线和数字(_ 、A-Z、a-z、0-9)

      一个嬴图实例中的用户不能重名。

      密码

      创建用户时需设置密码,规则如下:

      • 6~64个字符
      • 字符种类不限

      查看用户

      返回的表名:_user
      返回的表头:username | create | graphPrivileges | systemPrivileges | propertyPrivileges | policies(用户名、创建时间、图集权限、系统权限、属性权限、策略)

      // 查看当前实例中的所有用户信息
      show().user()
      
      // 查看当前实例中指定的用户信息
      show().user("<name>")
      
      // 查看当前登录的用户信息
      show().self()
      

      创建用户

      // 在当前实例中创建一个用户
      create().user(
        "<username>", 
        "<password>", 
        <{}graph_privileges?>, 
        <[]system_privileges?>, 
        <[]policies?>, 
        <{}property_privileges?>
      )
      

      其中的数据格式为:

      // <{}graph_privileges>
      {
        "<graph1>":["<graph_privilege>", "<graph_privilege>", ...],
        "<graph2>":["<graph_privilege>", "<graph_privilege>", ...],
        ...
      }
      
      // <{}property_privileges>
      {
        "node": {
          "read": [
            ["<graph>", "<@schema?>", "<property?>"],
            ["<graph>", "<@schema?>", "<property?>"],
            ...
          ],
          "write": [
            ["<graph>", "<@schema?>", "<property?>"],
            ["<graph>", "<@schema?>", "<property?>"],
            ...
          ],
          "deny": [
            ["<graph>", "<@schema?>", "<property?>"],
            ["<graph>", "<@schema?>", "<property?>"],
            ...
          ],
        },
        "edge": {
          "read": [
            ["<graph>", "<@schema?>", "<property?>"],
            ["<graph>", "<@schema?>", "<property?>"],
            ...
          ],
          "write": [
            ["<graph>", "<@schema?>", "<property?>"],
            ["<graph>", "<@schema?>", "<property?>"],
            ...
          ],
          "deny": [
            ["<graph>", "<@schema?>", "<property?>"],
            ["<graph>", "<@schema?>", "<property?>"],
            ...
          ],
        }
      }
      

      注1:图集名<graph>填星号(*)时表示当前实例的所有图集;同理,<@schema><property>填星号时表示所有schema和所有属性。
      注2:参数user()采用下标传参法,当不设置前项但需设置后项时,前项需使用空括号占位。

      本例创建用户user01,设置密码为pwABC123,赋予针对所有图集的图集权限UPDATE、ALGO、LTE和UFE,系统权限STAT、TOP和KILL,以及针对所有属性的属性权限WRITE:

      create().user(
        "user01",   
        "pwABC123",
        {"*": ["UPDATE","ALGO","LTE","UFE"]}, 
        ["STAT","TOP","KILL"], 
        [],
        {
          "node": {
            "write": [["*","*","*"]]
          },
          "edge": {
            "write": [["*","*","*"]]
          }
        }
      )
      

      修改用户

      // 修改当前实例中的指定用户
      alter().user("<username>").set({
        password:"<new?>", 
        graph_privileges: <{}graph_privileges?>, 
        system_privileges: <[]system_privileges?>, 
        policies: <[]policies?>,
        property_privileges: <{}property_privileges?>
      })
      

      其中<{}graph_privileges><{}property_privileges>的数据格式同创建用户

      本例将用户user01的密码修改为superFast:

      alter().user("user01").set({password: "superFast"})
      

      本例修改用户user01的权限,使其只能查看图集default的元数据:

      alter().user("user01").set({
        graph_privileges: {"default": ["FIND"]},
        property_privileges: {
          "node": {
            "read": [["default","*","*"]]
          },
          "edge": {
            "read": [["default","*","*"]]
          }
        }
      })
      

      只有当图集权限FIND和属性权限READ同时给到图集default及其元数据时,用户才能查看该图集的元数据。

      删除用户

      // 从当前实例中删除指定用户
      drop().user("<name>")
      

      重置管理员账户

      重置管理员账户需要通过工具ultipa-reset-user在服务器端进行,该操作不属于嬴图GQL的操作范畴。

      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写