added permission check
parent
3295194ffc
commit
ec472217ac
|
@ -223,7 +223,9 @@ export default function AppRoutes() {
|
||||||
Constants.PERMISSIONS.ADMIN_AREA.MANAGE
|
Constants.PERMISSIONS.ADMIN_AREA.MANAGE
|
||||||
.CHECK_WHICH_CATEGORIES_ARE_AVAILABLE,
|
.CHECK_WHICH_CATEGORIES_ARE_AVAILABLE,
|
||||||
Constants.PERMISSIONS.ADMIN_AREA.MANAGE
|
Constants.PERMISSIONS.ADMIN_AREA.MANAGE
|
||||||
.ADD_LOG_MANAGER_SERVER_CONNECTION
|
.ADD_LOG_MANAGER_SERVER_CONNECTION,
|
||||||
|
Constants.PERMISSIONS.ADMIN_AREA.MANAGE
|
||||||
|
.REMOVE_LOG_MANAGER_SERVER_CONNECTION
|
||||||
) && (
|
) && (
|
||||||
<Route
|
<Route
|
||||||
path={Constants.ROUTE_PATHS.ADMIN_AREA_MANAGE}
|
path={Constants.ROUTE_PATHS.ADMIN_AREA_MANAGE}
|
||||||
|
|
|
@ -160,7 +160,9 @@ export default function SideMenu({
|
||||||
Constants.PERMISSIONS.ADMIN_AREA.MANAGE
|
Constants.PERMISSIONS.ADMIN_AREA.MANAGE
|
||||||
.CHECK_WHICH_CATEGORIES_ARE_AVAILABLE,
|
.CHECK_WHICH_CATEGORIES_ARE_AVAILABLE,
|
||||||
Constants.PERMISSIONS.ADMIN_AREA.MANAGE
|
Constants.PERMISSIONS.ADMIN_AREA.MANAGE
|
||||||
.ADD_LOG_MANAGER_SERVER_CONNECTION
|
.ADD_LOG_MANAGER_SERVER_CONNECTION,
|
||||||
|
Constants.PERMISSIONS.ADMIN_AREA.MANAGE
|
||||||
|
.REMOVE_LOG_MANAGER_SERVER_CONNECTION
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
items.push({
|
items.push({
|
||||||
|
@ -209,7 +211,9 @@ export default function SideMenu({
|
||||||
Constants.PERMISSIONS.ADMIN_AREA.MANAGE
|
Constants.PERMISSIONS.ADMIN_AREA.MANAGE
|
||||||
.CHECK_WHICH_CATEGORIES_ARE_AVAILABLE,
|
.CHECK_WHICH_CATEGORIES_ARE_AVAILABLE,
|
||||||
Constants.PERMISSIONS.ADMIN_AREA.MANAGE
|
Constants.PERMISSIONS.ADMIN_AREA.MANAGE
|
||||||
.ADD_LOG_MANAGER_SERVER_CONNECTION
|
.ADD_LOG_MANAGER_SERVER_CONNECTION,
|
||||||
|
Constants.PERMISSIONS.ADMIN_AREA.MANAGE
|
||||||
|
.REMOVE_LOG_MANAGER_SERVER_CONNECTION
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
adminArea.children.push({
|
adminArea.children.push({
|
||||||
|
|
|
@ -60,7 +60,7 @@ function LogManagerServersTable({ t, webSocketContext, appContext }) {
|
||||||
] = useState(false);
|
] = useState(false);
|
||||||
|
|
||||||
const getColumns = () => {
|
const getColumns = () => {
|
||||||
return [
|
let columns = [
|
||||||
{
|
{
|
||||||
title: t("adminArea.manage.logManagers.column.displayName"),
|
title: t("adminArea.manage.logManagers.column.displayName"),
|
||||||
dataIndex: "displayName",
|
dataIndex: "displayName",
|
||||||
|
@ -76,7 +76,16 @@ function LogManagerServersTable({ t, webSocketContext, appContext }) {
|
||||||
dataIndex: "createdAt",
|
dataIndex: "createdAt",
|
||||||
key: "createdAt",
|
key: "createdAt",
|
||||||
},
|
},
|
||||||
{
|
];
|
||||||
|
|
||||||
|
if (
|
||||||
|
hasPermission(
|
||||||
|
appContext.userPermissions,
|
||||||
|
Constants.PERMISSIONS.ADMIN_AREA.MANAGE
|
||||||
|
.REMOVE_LOG_MANAGER_SERVER_CONNECTION
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
columns.push({
|
||||||
title: t("adminArea.manage.logManagers.column.action"),
|
title: t("adminArea.manage.logManagers.column.action"),
|
||||||
dataIndex: "action",
|
dataIndex: "action",
|
||||||
key: "action",
|
key: "action",
|
||||||
|
@ -101,8 +110,10 @@ function LogManagerServersTable({ t, webSocketContext, appContext }) {
|
||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
},
|
});
|
||||||
];
|
}
|
||||||
|
|
||||||
|
return columns;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getTableItems = () => {
|
const getTableItems = () => {
|
||||||
|
@ -146,7 +157,8 @@ function LogManagerServersTable({ t, webSocketContext, appContext }) {
|
||||||
|
|
||||||
{hasPermission(
|
{hasPermission(
|
||||||
appContext.userPermissions,
|
appContext.userPermissions,
|
||||||
Constants.PERMISSIONS.ALL_USERS.CREATE_NEW_USER
|
Constants.PERMISSIONS.ADMIN_AREA.MANAGE
|
||||||
|
.ADD_LOG_MANAGER_SERVER_CONNECTION
|
||||||
) && (
|
) && (
|
||||||
<Button
|
<Button
|
||||||
icon={<PlusOutlined />}
|
icon={<PlusOutlined />}
|
||||||
|
|
Loading…
Reference in New Issue