Hyperledger Fabric用户权限之间的差异

Nik*_*ili 9 hyperledger-fabric

如果我有一个组织orgA,并且在这个组织下我有2个用户:user1并且user2,还有1个对等orgA,我们可以调用它peer0.

现在想象一下,user1证书是orgA's msp/admincertsforlder,这使user1管理员orgA.另一方面,让我们说user2's证书在peer0's msp/admincerts文件夹中,这使user2管理员peer0.

我的问题是,user1和之间的权限有什么不同user2,我的意思是什么user1可以做什么,什么user2做不到,反之亦然?

我也在使用fabic canode sdk与网络互动.在我的例子中,当我从nod sdk注册fabric ca的bootstraped用户(admin/adminpw),然后创建创建通道请求时,它工作,但是当我进行加入通道请求时它失败了(因为这个用户没有权限).当我试图理解为什么会发生这种情况时,我发现如果我向用户发出加入请求证明该证书不在对等的msp/admincerts文件夹中,那么这种用户就没有权限让对等者加入频道.所以唯一的办法是我必须将注册的管理员证书复制到peer0的msp/admincerts文件夹中,然后我认为它会起作用,但这是使它工作的唯一方法,还是有其他方法可以避免复制/粘贴它从sdk,或创建新的配置更新事务?

另外我无法理解是什么让这个用户能够创建频道?bootsraped用户fabric ca 有哪些权限?

Cap*_*evi 1

这是一个很晚的回复,但希望有人会觉得这有帮助。用户角色和权限不直接链接,这是通过configtx.yaml.

为每个 Org 和 Orderer 定义策略,将每个成员和管理员标记为一组特定的策略子组,例如ReadersWritersAdmins。这些是用于构建 ImplicitMeta 策略(例如用于 chiancode 查询和写入)的基层策略。

例如,一个组织定义了类似的政策

# Policies defines the set of policies at this level of the config tree
        # For organization policies, their canonical path is usually
        #   /Channel/<Application|Orderer>/<OrgName>/<PolicyName>
        Policies: &org1Policies
            Readers:
                Type: Signature
                Rule: "OR('org1.example.com.member')"
                # If your MSP is configured with the new NodeOUs, you might
                # want to use a more specific rule like the following:
                # Rule: "OR('org1MSP.admin', 'org1MSP.peer')"
            Writers:
                Type: Signature
                Rule: "OR('org1.example.com.member')"
                # If your MSP is configured with the new NodeOUs, you might
                # want to use a more specific rule like the following:
                # Rule: "OR('org1MSP.admin', 'org1MSP.client'')"
            Admins:
                Type: Signature
                Rule: "OR('org1.example.com.admin')
Run Code Online (Sandbox Code Playgroud)

该联盟的政策定义如下:

Policies:
        Readers:
            Type: ImplicitMeta
            Rule: "ANY Readers"
        Writers:
            Type: ImplicitMeta
            Rule: "ANY Writers"
        Admins:
            Type: ImplicitMeta
            Rule: "MAJORITY Admins"
Run Code Online (Sandbox Code Playgroud)

这引用了之前定义的组织和排序者策略。

现在,在系统中,链码可以具有如下策略:

Application: &ApplicationDefaults
    ACLs: &ACLsDefault
        #This section provides defaults for policies for various resources
        #in the system.
    #---Query System Chaincode (qscc) function to policy mapping for access control---#

        #ACL policy for qscc's "GetChainInfo" function
        qscc/GetChainInfo: /Channel/Application/Readers

        #ACL policy for qscc's "GetBlockByNumber" function
        qscc/GetBlockByNumber: /Channel/Application/Readers
Run Code Online (Sandbox Code Playgroud)

这里所指的政策是指财团政策。

请阅读文档以获取更详细的指导。