组管理合约接口
Users Management
queryInfo
Parameters
address permission
- The permission addressReturns
bytes32 permission
- The permission nameaddress[] cont
- The contract address of the resourcebytes4[] func
- The function signature of the resourceExample
$ scm Permission queryInfo --permission 0xca645d2b0d2e4c451a2dd546dbd7ab8c29c3dcee
{
"id": 1,
"jsonrpc": "2.0",
"result": "0x0000000000000000000000000000000000000000000000000000000060fe47b2000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000020000000000000000000000005839153e0efe76efe0c974b728c4f49ca7ed75cc0000000000000000000000001e041ec9a18590924d84a1f011eb0749c03fc41a000000000000000000000000000000000000000000000000000000000000000260fe47b10000000000000000000000000000000000000000000000000000000060fe47b100000000000000000000000000000000000000000000000000000000"
}
queryName
Parameters
address permission
- The permission addressReturns
bytes32 name
- The permission nameExample
$ scm Permission queryName --permission 0xca645d2b0d2e4c451a2dd546dbd7ab8c29c3dcee
{
"id": 1,
"jsonrpc": "2.0",
"result": "0x0000000000000000000000000000000000000000000000000000000060fe47b2"
}
queryResource
Parameters
address permission
- The permission addressReturns
bool
- True, if successfully, otherwise false.Example
$ scm Permission queryResource --permission 0xca645d2b0d2e4c451a2dd546dbd7ab8c29c3dcee
{
"id": 1,
"jsonrpc": "2.0",
"result": "0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000020000000000000000000000005839153e0efe76efe0c974b728c4f49ca7ed75cc0000000000000000000000001e041ec9a18590924d84a1f011eb0749c03fc41a000000000000000000000000000000000000000000000000000000000000000260fe47b10000000000000000000000000000000000000000000000000000000060fe47b100000000000000000000000000000000000000000000000000000000"
}
newRole
deleteRole
updateRoleName
addPermissions
deletePermissions
setRole
cancelRole
clearRole
queryRoles
queryAccounts
queryName
queryPermissions
lengthOfPermissions
inPermissions
queryPermissions
queryAccounts
queryAllAccounts
addPermissions
checkResource
checkPermission
newGroup
创建一个用户组。
Parameters
address origin
- The sender's origin groupbytes32 name
- The name of groupaddress[] accounts
- The accounts of groupReturns
address
- The group addressExample
$ scm GroupManagement newGroup \
--origin 0xfFFfFFFFFffFFfffFFFFfffffFffffFFfF020009 \
--name 7770660000000000000000000000000000000000000000000000000000000000 \
--accounts "[e1c4021742730ded647590a1686d5c4bfcbae0b0,45a50f45cb81c8aedeab917ea0cd3c9178ebdcae]" \
--private-key 0x5f0258a4778057a8a7d97809bd209055b2fbafa654ce7d31ec7191066b9225e6
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"blockHash": "0x0771624fa18da8380cf87238bd0dbb1e4114f2d707bdf9be6265c4ed50016960",
"blockNumber": "0x6922",
"contractAddress": null,
"cumulativeGasUsed": "0x1b8fcf",
"errorMessage": null,
"gasUsed": "0x1b8fcf",
"logs": [
{
"address": "0xce6cd8f8562e31d44b1101986204cec34b1df025",
"blockHash": "0x0771624fa18da8380cf87238bd0dbb1e4114f2d707bdf9be6265c4ed50016960",
"blockNumber": "0x6922",
"data": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000e1c4021742730ded647590a1686d5c4bfcbae0b000000000000000000000000045a50f45cb81c8aedeab917ea0cd3c9178ebdcae",
"logIndex": "0x0",
"topics": [
"0x876145257ed9001029e48f639669c6a3d20c2256585b00a716e557653ccb4813",
"0x000000000000000000000000ffffffffffffffffffffffffffffffffff020009",
"0x7770660000000000000000000000000000000000000000000000000000000000"
],
"transactionHash": "0x948de6f242b4ed2638ff4874febfd824facec1e71907154f1532ea19f78f8b21",
"transactionIndex": "0x0",
"transactionLogIndex": "0x0"
},
{
"address": "0xffffffffffffffffffffffffffffffffff02000b",
"blockHash": "0x0771624fa18da8380cf87238bd0dbb1e4114f2d707bdf9be6265c4ed50016960",
"blockNumber": "0x6922",
"data": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000e1c4021742730ded647590a1686d5c4bfcbae0b000000000000000000000000045a50f45cb81c8aedeab917ea0cd3c9178ebdcae",
"logIndex": "0x1",
"topics": [
"0xe676706adf1adf2871518b989e3e4ae7c1cc5bf8bb6012ecc94652f84edf4adf",
"0x000000000000000000000000ce6cd8f8562e31d44b1101986204cec34b1df025",
"0x000000000000000000000000ffffffffffffffffffffffffffffffffff020009",
"0x7770660000000000000000000000000000000000000000000000000000000000"
],
"transactionHash": "0x948de6f242b4ed2638ff4874febfd824facec1e71907154f1532ea19f78f8b21",
"transactionIndex": "0x0",
"transactionLogIndex": "0x1"
},
{
"address": "0xffffffffffffffffffffffffffffffffff020009",
"blockHash": "0x0771624fa18da8380cf87238bd0dbb1e4114f2d707bdf9be6265c4ed50016960",
"blockNumber": "0x6922",
"data": "0x",
"logIndex": "0x2",
"topics": [
"0xa016866023d98d9af30c4dd99810d92915ae7897f25baa30c8c826bf077f486b",
"0x000000000000000000000000ce6cd8f8562e31d44b1101986204cec34b1df025"
],
"transactionHash": "0x948de6f242b4ed2638ff4874febfd824facec1e71907154f1532ea19f78f8b21",
"transactionIndex": "0x0",
"transactionLogIndex": "0x2"
}
],
"logsBloom": "0x00000002000000100000000000800000000000000000400004020000100000000000000000000002000000000080000000000000000000000000000000000002000000000000000000000000000080000004000000001000000000000004000000000000000000000010000000000000100000000020000000000000000000000000000000000000000000000000000000000000001000000000000040000000000000000000000000000000000000000000000000000000000000000000000400400000800004000000000000000000000000000000020010000000000000000000000000000000000000000000008000000000000001000000000000000000",
"root": null,
"transactionHash": "0x948de6f242b4ed2638ff4874febfd824facec1e71907154f1532ea19f78f8b21",
"transactionIndex": "0x0"
}
}
从 log 中可知,新用户组的地址是: 0xce6cd8f8562e31d44b1101986204cec34b1df025
deleteGroup
删除用户组。
Parameters
address origin
- The sender's orgin groupaddress target
- The target group to be deletedReturns
bool
- True, if successfully, otherwise false.Example
$ scm GroupManagement deleteGroup \
--origin 0xfFFfFFFFFffFFfffFFFFfffffFffffFFfF020009 \
--target 0xce6cd8f8562e31d44b1101986204cec34b1df025 \
--private-key 0x5f0258a4778057a8a7d97809bd209055b2fbafa654ce7d31ec7191066b9225e6 \
updateGroupName
更新用户组名称。
Parameters
address origin
- The sender's orgin groupaddress target
- The target groupbytes32 name
- The new name to be updatedReturns
bool
- True, if successfully, otherwise false.Example
$ scm GroupManagement updateGroupName \
--origin 0xfFFfFFFFFffFFfffFFFFfffffFffffFFfF020009 \ --target 0xce6cd8f8562e31d44b1101986204cec34b1df025 \
--name 8880660000000000000000000000000000000000000000000000000000000000 \
--private-key 0x5f0258a4778057a8a7d97809bd209055b2fbafa654ce7d31ec7191066b9225e6 \
addAccounts
添加用户。
Parameters
address origin
- The sender's orgin groupaddress target
- The target groupaddress[] accounts
- The accounts to be addedReturns
bool
- True, if successfully, otherwise false.Examplee
$ scm GroupManagement addAccounts \
--origin 0xfFFfFFFFFffFFfffFFFFfffffFffffFFfF020009 \ --target 0xce6cd8f8562e31d44b1101986204cec34b1df025 \
--accounts '[887d3378018c45ec72bed1947d34ac59a4402ddb,f7636f910e2fff0014d693498fe43d2e539b8742]' \
--private-key 0x5f0258a4778057a8a7d97809bd209055b2fbafa654ce7d31ec7191066b9225e6 \
deleteAccounts
删除用户。
Parameters
address origin
- The sender's orgin groupaddress target
- The target groupaddress[] accounts
- The accounts to be deletedReturns
bool
- True, if successfully, otherwise false.Example
$ scm GroupManagement deleteAccounts \
--origin 0xfFFfFFFFFffFFfffFFFFfffffFffffFFfF020009 \
--target 0xce6cd8f8562e31d44b1101986204cec34b1df025 \
--accounts '[887d3378018c45ec72bed1947d34ac59a4402ddb,f7636f910e2fff0014d693498fe43d2e539b8742]' \
--private-key 0x5f0258a4778057a8a7d97809bd209055b2fbafa654ce7d31ec7191066b9225e6 \
checkScope
Parameters
address origin
- The sender's orgin groupaddress target
- The target groupReturns
bool
- True, if successfully, otherwise false.Example
$ scm GroupManagement checkScope \
--origin 0xfFFfFFFFFffFFfffFFFFfffffFffffFFfF020009 \
--target 0xce6cd8f8562e31d44b1101986204cec34b1df025 \
queryGroups
查询所有组。
Parameters
None
Returns
address[]
- All groups addressExample
$ scm GroupManagement queryGroups
queryInfo
查询组信息。
Parameters
address group
- The group addressReturns
bytes32 name
- The name of groupaddress[] accounts
- The accounts of groupExample
$ scm Group queryInfo --address 0xce6cd8f8562e31d44b1101986204cec34b1df025
queryName
查询组名字。
Parameters
address group
- The group addressReturns
bytes32 name
- The name of groupExample
$ scm Group queryName --address 0xce6cd8f8562e31d44b1101986204cec34b1df025
queryAccounts
查询组内所有用户。
Parameters
address group
- The group addressReturns
address[]
- All accounts addressExample
$ scm Group queryAccounts --address 0xce6cd8f8562e31d44b1101986204cec34b1df025
queryChild
查询子组。
Parameters
address group
- The group addressReturns
address
- The children of groupExample
$ scm Group queryChild --address 0xfFFfFFFFFffFFfffFFFFfffffFffffFFfF020009
queryChildLength
查询子组个数。
Parameters
address group
- The group addressReturns
uint
- The number of the children groupExample
$ scm Group queryChildLength --address 0xfFFfFFFFFffFFfffFFFFfffffFffffFFfF020009
queryParent
查询父组。
Parameters
address group
- The group addressReturns
address
- The parent of the groupExample
$ scm Group queryParent --address 0xce6cd8f8562e31d44b1101986204cec34b1df025