| 837 | } |
| 838 | |
| 839 | func populateClaimMap(m map[string]interface{}, cp *claimParam) { |
| 840 | m["claimType"] = string(cp.claimType) |
| 841 | switch cp.claimType { |
| 842 | case ShareClaim: |
| 843 | m["authType"] = cp.authType |
| 844 | m["transitive"] = cp.transitive |
| 845 | case DeleteClaim: |
| 846 | m["target"] = cp.target.String() |
| 847 | default: |
| 848 | m["permaNode"] = cp.permanode.String() |
| 849 | m["attribute"] = cp.attribute |
| 850 | if !(cp.claimType == DelAttributeClaim && cp.value == "") { |
| 851 | m["value"] = cp.value |
| 852 | } |
| 853 | } |
| 854 | } |
| 855 | |
| 856 | // NewShareRef creates a *Builder for a "share" claim. |
| 857 | func NewShareRef(authType string, transitive bool) *Builder { |