Commit be2ed024 authored by shajiaiming's avatar shajiaiming

remove group

parent 5572fbce
......@@ -21,12 +21,12 @@ func AddGroupingPolicy(params map[string]interface{}) error {
return nil
}
func RemovePolicy(params ...interface{}) error {
return nil
func RemoveGroupingPolicy(ptype string, fieldIndex int, fieldValues string) bool {
success, _ := rbac.Ef.RemoveFilteredNamedGroupingPolicy(ptype, fieldIndex, fieldValues)
return success
}
func ClearCasbin(ptype string, fieldIndex int, fieldValues string) bool {
func RemovePolicy(ptype string, fieldIndex int, fieldValues string) bool {
success, _ := rbac.Ef.RemoveFilteredNamedPolicy(ptype, fieldIndex, fieldValues)
return success
}
......@@ -39,7 +39,7 @@ func (r *SetPermission) AddPolicy() error {
for _, v := range r.AllowPermissions {
rules = append(rules, []string{r.Value, v.Path, v.Method})
}
models.ClearCasbin("p", 0, r.Value)
models.RemovePolicy("p", 0, r.Value)
models.AddPolicy(rules)
return nil
}
......@@ -49,7 +49,7 @@ func (r *CasbinRole) AddGroupingPolicy() error {
"v0": r.V0,
"v1": r.V1,
}
models.RemoveGroupingPolicy("g", 0, r.V0)
if err := models.AddGroupingPolicy(role); err != nil {
return err
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment