Commit 26c9516d authored by Leander Schulten's avatar Leander Schulten

Permissions: Remove Settings_Tab permission and add permissions for the individual settings

parent 04a8b72c
Pipeline #195774 passed with stage
in 4 minutes and 36 seconds
......@@ -4,6 +4,7 @@ import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.12
import QtQuick.Dialogs 1.3 as SystemDialog
import QtQuick.Window 2.12
import custom.licht 1.0
import "components"
Pane{
......@@ -17,6 +18,7 @@ Pane{
}
RowLayout{
id: root
enabled: UserManagment.currentUser.havePermission(Permission.CHANGE_SETTINGS_FILE_PATH)
Item{
Layout.fillWidth: true
Layout.preferredWidth: inputSettingsPath.implicitWidth
......@@ -67,6 +69,7 @@ Pane{
text: "Driver file path:"
}
TextFieldFileChooser{
enabled: UserManagment.currentUser.havePermission(Permission.CHANGE_DMX_DRIVER_LIB)
Layout.fillWidth: true
folder: false
path: Settings.driverFilePath
......@@ -78,6 +81,7 @@ Pane{
text: "Update pause for dmx in ms:"
}
TextInputField{
enabled: UserManagment.currentUser.havePermission(Permission.CHANGE_DMX_UPDATE_RATE)
validator: IntValidator{
bottom: 10
top: 10000
......@@ -91,6 +95,7 @@ Pane{
text: "Module Directory:"
}
TextFieldFileChooser{
enabled: UserManagment.currentUser.havePermission(Permission.CHANGE_MODULE_SETTINGS)
Layout.fillWidth: true
folder: true
path: Settings.moduleDirPath
......@@ -103,6 +108,7 @@ Pane{
text: "Compiler File Path:"
}
TextFieldFileChooser{
enabled: UserManagment.currentUser.havePermission(Permission.CHANGE_MODULE_SETTINGS)
Layout.fillWidth: true
folder: true
path: Settings.compilerPath
......@@ -115,6 +121,7 @@ Pane{
text: "Include Path:"
}
TextFieldFileChooser{
enabled: UserManagment.currentUser.havePermission(Permission.CHANGE_MODULE_SETTINGS)
Layout.fillWidth: true
folder: true
path: Settings.includePath
......@@ -127,6 +134,7 @@ Pane{
text: "Compiler Flags:"
}
TextInputField{
enabled: UserManagment.currentUser.havePermission(Permission.CHANGE_MODULE_SETTINGS)
Layout.fillWidth: true
text: Settings.compilerFlags
onAccepted: Settings.compilerFlags = text;
......@@ -137,6 +145,7 @@ Pane{
text: "Compiler Library Flags:"
}
TextInputField{
enabled: UserManagment.currentUser.havePermission(Permission.CHANGE_MODULE_SETTINGS)
Layout.fillWidth: true
text: Settings.compilerLibraryFlags
onAccepted: Settings.compilerLibraryFlags = text;
......@@ -158,6 +167,7 @@ Pane{
text: "Theme:"
}
Button{
enabled: UserManagment.currentUser.havePermission(Permission.MODIFY_THEME)
text: "Modify Theme and appearance"
onClicked: modifyThemeWindow.show()
}
......
......@@ -109,7 +109,6 @@ ApplicationWindow {
}
VerticalTabButton {
text: qsTr("Settings")
enabled: UserManagment.currentUser.havePermission(Permission.SETTINGS_TAB);
}
VerticalTabButton {
text: qsTr("Modules")
......
......@@ -46,13 +46,37 @@ public:
/**
* @brief The Permission enum contains all Permissions a User can have
*/
enum Permission{
Admin=0, Read=1, Write=2,
ADD_DEVICE=3,REMOVE_DEVICE=4,CHANGE_POSITION=5, CHANGE_NAME=6,CHANGE_DEVICE_DMX_CHANNEL=7,
DEVICE_TAB=8,DEVICE_PROTOTYPE_TAB=9,PROGRAMM_PROTOTYPE_TAY=10,PROGRAMM_TAB=11,
MOVE_CONTROL_ITEM=12, ADD_CONTROL_ITEM=13, CHANGE_GROUP_NAME=14, CHANGE_GROUP_DEVICES=15, CHANGE_MIN_MAX_MAPPING=16, CHANGE_TIMEOUTS=17, REMOVE_CONTROL_ITEM=18,
SETTINGS_TAB=19, MODULES_TAB=20, MODULE_PROGRAMS_TAB=21, CHANGE_CONTROL_ITEM_VISIBILITY=22,
LAST_PERMISSION=23
enum Permission {
Admin = 0,
Read = 1,
Write = 2,
ADD_DEVICE = 3,
REMOVE_DEVICE = 4,
CHANGE_POSITION = 5,
CHANGE_NAME = 6,
CHANGE_DEVICE_DMX_CHANNEL = 7,
DEVICE_TAB = 8,
DEVICE_PROTOTYPE_TAB = 9,
PROGRAMM_PROTOTYPE_TAY = 10,
PROGRAMM_TAB = 11,
MOVE_CONTROL_ITEM = 12,
ADD_CONTROL_ITEM = 13,
CHANGE_GROUP_NAME = 14,
CHANGE_GROUP_DEVICES = 15,
CHANGE_MIN_MAX_MAPPING = 16,
CHANGE_TIMEOUTS = 17,
REMOVE_CONTROL_ITEM = 18,
// SETTINGS_TAB = 19,
MODULES_TAB = 20,
MODULE_PROGRAMS_TAB = 21,
CHANGE_CONTROL_ITEM_VISIBILITY = 22,
CHANGE_DMX_DRIVER_LIB = 23,
CHANGE_DMX_UPDATE_RATE = 24,
CHANGE_SETTINGS_FILE_PATH = 25,
CHANGE_MODULE_SETTINGS = 26,
MODIFY_THEME = 27,
SAVE_SLIDE_SHOW_SETTINGS = 28,
LAST_PERMISSION = 29,
};
Q_ENUM(Permission)
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment