我正在给sec打个电话:角色-存在()。我正试图弄清楚需要什么样的权限才能授予管理员以外的其他人这种能力。我得到的错误意味着我需要http://marklogic.com/xdmp/privileges/get-role特权。
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:特权添加角色使用管理帐户授予这个角色时,它会告诉我特权不存在。
[1.0-ml] SEC-PRIVDNE: (err:FOER0000) Privilege does not exist: action(http://marklogic.com/xdmp/privileges/get-role), kind(execute)有什么想法吗?
下面是我用来授予的代码片段,我是以admin的身份运行的。
(: 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>
)发布于 2016-02-17 01:11:28
实际上,这个特权不是在安装时创建的,这实际上是一个bug。这将在下一个版本中得到纠正,但在此期间,您可以手动在安全数据库中创建它。
sec:create-privilege(
"role-exists",
"http://marklogic.com/xdmp/privileges/get-role",
"execute",
"security")https://stackoverflow.com/questions/35443547
复制相似问题