mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 13:20:19 +08:00
feat: support RBAC model in permission (#1006)
Signed-off-by: Yixiang Zhao <seriouszyx@foxmail.com> Signed-off-by: Yixiang Zhao <seriouszyx@foxmail.com>
This commit is contained in:
@ -210,6 +210,20 @@ class PermissionEditPage extends React.Component {
|
||||
</Select>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("role:Sub domains"), i18next.t("role:Sub domains - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Select virtual={false} mode="tags" style={{width: "100%"}} value={this.state.permission.domains} onChange={(value => {
|
||||
this.updateRoleField("domains", value);
|
||||
})}>
|
||||
{
|
||||
this.state.permission.domains.map((domain, index) => <Option key={index} value={domain}>{domain}</Option>)
|
||||
}
|
||||
</Select>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("permission:Resource type"), i18next.t("permission:Resource type - Tooltip"))} :
|
||||
|
@ -31,6 +31,7 @@ class PermissionListPage extends BaseListPage {
|
||||
displayName: `New Permission - ${randomName}`,
|
||||
users: [],
|
||||
roles: [],
|
||||
domains: [],
|
||||
resourceType: "Application",
|
||||
resources: ["app-built-in"],
|
||||
actions: ["Read"],
|
||||
@ -139,6 +140,16 @@ class PermissionListPage extends BaseListPage {
|
||||
return Setting.getTags(text);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18next.t("role:Sub domains"),
|
||||
dataIndex: "domains",
|
||||
key: "domains",
|
||||
sorter: true,
|
||||
...this.getColumnSearchProps("domains"),
|
||||
render: (text, record, index) => {
|
||||
return Setting.getTags(text);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18next.t("permission:Resource type"),
|
||||
dataIndex: "resourceType",
|
||||
|
@ -164,6 +164,20 @@ class RoleEditPage extends React.Component {
|
||||
</Select>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||
{Setting.getLabel(i18next.t("role:Sub domains"), i18next.t("role:Sub domains - Tooltip"))} :
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Select virtual={false} mode="tags" style={{width: "100%"}} value={this.state.role.domains} onChange={(value => {
|
||||
this.updateRoleField("domains", value);
|
||||
})}>
|
||||
{
|
||||
this.state.role.domains.map((domain, index) => <Option key={index} value={domain}>{domain}</Option>)
|
||||
}
|
||||
</Select>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: "20px"}} >
|
||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 19 : 2}>
|
||||
{Setting.getLabel(i18next.t("general:Is enabled"), i18next.t("general:Is enabled - Tooltip"))} :
|
||||
|
@ -31,6 +31,7 @@ class RoleListPage extends BaseListPage {
|
||||
displayName: `New Role - ${randomName}`,
|
||||
users: [],
|
||||
roles: [],
|
||||
domains: [],
|
||||
isEnabled: true,
|
||||
};
|
||||
}
|
||||
@ -135,6 +136,16 @@ class RoleListPage extends BaseListPage {
|
||||
return Setting.getTags(text);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18next.t("role:Sub domains"),
|
||||
dataIndex: "domains",
|
||||
key: "domains",
|
||||
sorter: true,
|
||||
...this.getColumnSearchProps("domains"),
|
||||
render: (text, record, index) => {
|
||||
return Setting.getTags(text);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: i18next.t("general:Is enabled"),
|
||||
dataIndex: "isEnabled",
|
||||
|
Reference in New Issue
Block a user