mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-08 00:50:28 +08:00
Remove useless PermissionRule
This commit is contained in:
@ -96,7 +96,7 @@ p, *, *, GET, /api/get-organization-names, *, *
|
|||||||
|
|
||||||
sa := stringadapter.NewAdapter(ruleText)
|
sa := stringadapter.NewAdapter(ruleText)
|
||||||
// load all rules from string adapter to enforcer's memory
|
// load all rules from string adapter to enforcer's memory
|
||||||
err := sa.LoadPolicy(Enforcer.GetModel())
|
err = sa.LoadPolicy(Enforcer.GetModel())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
@ -329,11 +329,6 @@ func (a *Ormer) createTable() {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = a.Engine.Sync2(new(PermissionRule))
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
err = a.Engine.Sync2(new(xormadapter.CasbinRule))
|
err = a.Engine.Sync2(new(xormadapter.CasbinRule))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
@ -49,17 +49,6 @@ type Permission struct {
|
|||||||
State string `xorm:"varchar(100)" json:"state"`
|
State string `xorm:"varchar(100)" json:"state"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type PermissionRule struct {
|
|
||||||
Ptype string `xorm:"varchar(100) index not null default ''" json:"ptype"`
|
|
||||||
V0 string `xorm:"varchar(100) index not null default ''" json:"v0"`
|
|
||||||
V1 string `xorm:"varchar(100) index not null default ''" json:"v1"`
|
|
||||||
V2 string `xorm:"varchar(100) index not null default ''" json:"v2"`
|
|
||||||
V3 string `xorm:"varchar(100) index not null default ''" json:"v3"`
|
|
||||||
V4 string `xorm:"varchar(100) index not null default ''" json:"v4"`
|
|
||||||
V5 string `xorm:"varchar(100) index not null default ''" json:"v5"`
|
|
||||||
Id string `xorm:"varchar(100) index not null default ''" json:"id"`
|
|
||||||
}
|
|
||||||
|
|
||||||
const builtInAvailableField = 5 // Casdoor built-in adapter, use V5 to filter permission, so has 5 available field
|
const builtInAvailableField = 5 // Casdoor built-in adapter, use V5 to filter permission, so has 5 available field
|
||||||
|
|
||||||
func GetPermissionCount(owner, field, value string) (int64, error) {
|
func GetPermissionCount(owner, field, value string) (int64, error) {
|
||||||
|
Reference in New Issue
Block a user