Add AuthzFilter.

This commit is contained in:
Yang Luo
2021-02-28 20:23:50 +08:00
parent dfa77ab25d
commit ba4185c9b1
10 changed files with 250 additions and 84 deletions

View File

@ -79,7 +79,7 @@ func UpdateApplication(id string, application *Application) bool {
return false
}
_, err := adapter.engine.Id(core.PK{owner, name}).AllCols().Update(application)
_, err := adapter.engine.ID(core.PK{owner, name}).AllCols().Update(application)
if err != nil {
panic(err)
}
@ -98,7 +98,7 @@ func AddApplication(application *Application) bool {
}
func DeleteApplication(application *Application) bool {
affected, err := adapter.engine.Id(core.PK{application.Owner, application.Name}).Delete(&Application{})
affected, err := adapter.engine.ID(core.PK{application.Owner, application.Name}).Delete(&Application{})
if err != nil {
panic(err)
}

View File

@ -63,7 +63,7 @@ func UpdateOrganization(id string, organization *Organization) bool {
return false
}
_, err := adapter.engine.Id(core.PK{owner, name}).AllCols().Update(organization)
_, err := adapter.engine.ID(core.PK{owner, name}).AllCols().Update(organization)
if err != nil {
panic(err)
}
@ -82,7 +82,7 @@ func AddOrganization(organization *Organization) bool {
}
func DeleteOrganization(organization *Organization) bool {
affected, err := adapter.engine.Id(core.PK{organization.Owner, organization.Name}).Delete(&Organization{})
affected, err := adapter.engine.ID(core.PK{organization.Owner, organization.Name}).Delete(&Organization{})
if err != nil {
panic(err)
}

View File

@ -66,7 +66,7 @@ func UpdateProvider(id string, provider *Provider) bool {
return false
}
_, err := adapter.engine.Id(core.PK{owner, name}).AllCols().Update(provider)
_, err := adapter.engine.ID(core.PK{owner, name}).AllCols().Update(provider)
if err != nil {
panic(err)
}
@ -85,7 +85,7 @@ func AddProvider(provider *Provider) bool {
}
func DeleteProvider(provider *Provider) bool {
affected, err := adapter.engine.Id(core.PK{provider.Owner, provider.Name}).Delete(&Provider{})
affected, err := adapter.engine.ID(core.PK{provider.Owner, provider.Name}).Delete(&Provider{})
if err != nil {
panic(err)
}

View File

@ -96,7 +96,7 @@ func UpdateUser(id string, user *User) bool {
return false
}
_, err := adapter.engine.Id(core.PK{owner, name}).AllCols().Update(user)
_, err := adapter.engine.ID(core.PK{owner, name}).AllCols().Update(user)
if err != nil {
panic(err)
}
@ -116,7 +116,7 @@ func AddUser(user *User) bool {
}
func DeleteUser(user *User) bool {
affected, err := adapter.engine.Id(core.PK{user.Owner, user.Name}).Delete(&User{})
affected, err := adapter.engine.ID(core.PK{user.Owner, user.Name}).Delete(&User{})
if err != nil {
panic(err)
}