您好,登錄后才能下訂單哦!
這篇文章主要介紹“Java創(chuàng)建或修改權(quán)限的方法是什么”,在日常操作中,相信很多人在Java創(chuàng)建或修改權(quán)限的方法是什么問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”Java創(chuàng)建或修改權(quán)限的方法是什么”的疑惑有所幫助!接下來,請跟著小編一起來學(xué)習(xí)吧!
命令格式:$ cleos set account permission ${permission} ${account} ${permission_json} ${account_authority}
要修改帳戶的權(quán)限,你必須擁有該帳戶的權(quán)限和你正在修改的權(quán)限。設(shè)置帳戶權(quán)限命令可能會更改,因此它關(guān)聯(lián)的類沒有完整記錄。
$ cleos set account permission test active '{"threshold" : 1, "keys" : [{"permission":{"key":"EOS8X7Mp7apQWtL6T2sfSZzBcQNUqZB7tARFEm9gA9Tn9nbMdsvBB","permission":"active"},"weight":1}], "accounts" : [{"permission":{"actor":"acc2","permission":"active"},"weight":50}]}' owner
第二個示例修改相同的帳戶權(quán)限,但刪除上一個示例中的密鑰集,并將@test帳戶的活動權(quán)限授予另一個帳戶。
$ cleos set account permission test active '{"threshold" : 1, "keys" : [], "accounts" : [{"permission":{"actor":"sandwich","permission":"active"},"weight":1},{"permission":{"actor":"acc1","permission":"active"},"weight":50}]}' owner
第三個示例演示如何設(shè)置multisig的權(quán)限
$ cleos set account permission test active '{"threshold" : 100, "keys" : [{"permission":{"key":"EOS8X7Mp7apQWtL6T2sfSZzBcQNUqZB7tARFEm9gA9Tn9nbMdsvBB","permission":"active"},"weight":25}], "accounts" : [{"permission":{"actor":"@sandwich","permission":"active"},"weight":75}]}' owner
此命令中使用的JSON對象實際上由兩種不同類型的對象組成 權(quán)限JSON對象...
{ "threshold" : 100, /*An integer that defines cumulative signature weight required for authorization*/ "keys" : [], /*An array made up of individual permissions defined with an EOS PUBLIC KEY*/ "accounts" : [] /*An array made up of individual permissions defined with an EOS ACCOUNT*/ }
...其中包括一個或多個權(quán)限對象
/*Set Permission with Key*/ { "permission" : { "key" : "EOS8X7Mp7apQWtL6T2sfSZzBcQNUqZB7tARFEm9gA9Tn9nbMdsvBB", "permission" : "active" }, weight : 25 /*Set the weight of a signature from this permission*/ } /*Set Permission with Account*/ { "permission" : { "actor" : "sandwich", "permission" : "active" }, weight : 75 /*Set the weight of a signature from this permission*/ }
到此,關(guān)于“Java創(chuàng)建或修改權(quán)限的方法是什么”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識,請繼續(xù)關(guān)注億速云網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬嵱玫奈恼拢?/p>
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。