mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 13:20:19 +08:00
Improve add model initialization
This commit is contained in:
@ -22,6 +22,21 @@ import i18next from "i18next";
|
||||
import BaseListPage from "./BaseListPage";
|
||||
import PopconfirmModal from "./common/modal/PopconfirmModal";
|
||||
|
||||
const rbacModel = `[request_definition]
|
||||
r = sub, obj, act
|
||||
|
||||
[policy_definition]
|
||||
p = sub, obj, act
|
||||
|
||||
[role_definition]
|
||||
g = _, _
|
||||
|
||||
[policy_effect]
|
||||
e = some(where (p.eft == allow))
|
||||
|
||||
[matchers]
|
||||
m = g(r.sub, p.sub) && r.obj == p.obj && r.act == p.act`;
|
||||
|
||||
class ModelListPage extends BaseListPage {
|
||||
newModel() {
|
||||
const randomName = Setting.getRandomName();
|
||||
@ -30,7 +45,7 @@ class ModelListPage extends BaseListPage {
|
||||
name: `model_${randomName}`,
|
||||
createdTime: moment().format(),
|
||||
displayName: `New Model - ${randomName}`,
|
||||
modelText: "",
|
||||
modelText: rbacModel,
|
||||
isEnabled: true,
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user