我有一个yml文件,就像这样我写了所有的角色 角色标签。
admin标记继承了角色的所有属性,但我希望defalut标记只能继承role_5。怎么做??
roles: &all
role_1: "edit"
role_2: "create"
role_3: "read"
role_4: "update"
role_5: "writepost"
admin:
<<: *all #inherits all
default :
<<:only inherit role_5 # what should i write ???
答案 0 :(得分:1)
像这样:
roles: &all
role_1: "edit"
role_2: "create"
role_3: "read"
role_4: "update"
role_5: &role_5
"writepost"
admin:
<<: *all #inherits all
default: *role_5