首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何授予http://marklogic.com/xdmp/privileges/get-role特权?

如何授予http://marklogic.com/xdmp/privileges/get-role特权?
EN

Stack Overflow用户
提问于 2016-02-16 21:40:38
回答 1查看 422关注 0票数 4

我正在给sec打个电话:角色-存在()。我正试图弄清楚需要什么样的权限才能授予管理员以外的其他人这种能力。我得到的错误意味着我需要http://marklogic.com/xdmp/privileges/get-role特权。

代码语言:javascript
复制
SEC-PRIVDNE: xdmp:security-assert("http://marklogic.com/xdmp/privileges/get-role", "execute") -- Privilege does not exist: action(http://marklogic.com/xdmp/privileges/get-role), kind(execute)

但是,当我试图通过sec:特权添加角色使用管理帐户授予这个角色时,它会告诉我特权不存在。

代码语言:javascript
复制
[1.0-ml] SEC-PRIVDNE: (err:FOER0000) Privilege does not exist: action(http://marklogic.com/xdmp/privileges/get-role), kind(execute)

有什么想法吗?

下面是我用来授予的代码片段,我是以admin的身份运行的。

代码语言:javascript
复制
(: grant the needed privileges to the role :)
let $grant_privs :=
xdmp:invoke-function(
  function() {
    let $required_roles := (
      "http://marklogic.com/xdmp/privileges/create-role",
      "http://marklogic.com/xdmp/privileges/remove-role",
      "http://marklogic.com/xdmp/privileges/get-role-ids",
      "http://marklogic.com/xdmp/privileges/get-role-names",
      "http://marklogic.com/xdmp/privileges/get-role",
      "http://marklogic.com/xdmp/privileges/xdmp-invoke-in",
      "http://marklogic.com/xdmp/privileges/xdmp-invoke"
    )

    return
      for $r in $required_roles
        return
          sec:privilege-add-roles(
            $r,
            "execute",
            "auth-lib"
          )
  },
  <options xmlns="xdmp:eval">
    <database>{ xdmp:security-database() }</database>
    <transaction-mode>update-auto-commit</transaction-mode>
    <isolation>different-transaction</isolation>
  </options>
)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-02-17 01:11:28

实际上,这个特权不是在安装时创建的,这实际上是一个bug。这将在下一个版本中得到纠正,但在此期间,您可以手动在安全数据库中创建它。

代码语言:javascript
复制
sec:create-privilege(
  "role-exists",
  "http://marklogic.com/xdmp/privileges/get-role",
  "execute",
  "security")
票数 7
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35443547

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档