mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 19:40:19 +08:00
Add AuthzFilter.
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user