|
|
|
@ -174,6 +174,13 @@ private slots:
|
|
|
|
|
protected:
|
|
|
|
|
virtual void handleNewRecord() override
|
|
|
|
|
{
|
|
|
|
|
PermissionEvaluator permEv;
|
|
|
|
|
if (!permEv.hasPermission(pluginId(), PERM_ADD))
|
|
|
|
|
{
|
|
|
|
|
QMessageBox::critical(this, tr("Permission denied"), tr("You don't have permission to add new record."));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_form == NULL)
|
|
|
|
|
{
|
|
|
|
|
Q_ASSERT(false);
|
|
|
|
@ -187,6 +194,13 @@ protected:
|
|
|
|
|
|
|
|
|
|
virtual void handleEditRecord() override
|
|
|
|
|
{
|
|
|
|
|
PermissionEvaluator permEv;
|
|
|
|
|
if (!permEv.hasPermission(pluginId(), PERM_EDIT))
|
|
|
|
|
{
|
|
|
|
|
QMessageBox::critical(this, tr("Permission denied"), tr("You don't have permission to edit record."));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_form == NULL || m_tableModel == NULL || tableView()->currentIndex().row() < 0)
|
|
|
|
|
{
|
|
|
|
|
Q_ASSERT(false);
|
|
|
|
@ -200,6 +214,13 @@ protected:
|
|
|
|
|
|
|
|
|
|
void handleDeleteRecord() override
|
|
|
|
|
{
|
|
|
|
|
PermissionEvaluator permEv;
|
|
|
|
|
if (!permEv.hasPermission(pluginId(), PERM_DELETE))
|
|
|
|
|
{
|
|
|
|
|
QMessageBox::critical(this, tr("Permission denied"), tr("You don't have permission to delete record."));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_permissionDenied = false;
|
|
|
|
|
connectService();
|
|
|
|
|
if (m_form == NULL || m_tableModel == NULL || tableView()->currentIndex().row() < 0)
|
|
|
|
|