🐛 Update: Enhanced API for printer list retrieval with additional query parameters for filtering active and inactive printers. Improved response structure to include printer reachability and display status for better UI integration. Added granular permissions management in user creation process. 📚
This commit is contained in:
@ -284,6 +284,55 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Granulare Berechtigungen -->
|
||||
<div class="form-field-premium mt-8" id="permissionsSection">
|
||||
<label class="block text-sm font-semibold text-slate-900 dark:text-white mb-3 transition-colors duration-300">
|
||||
<svg class="w-4 h-4 inline mr-2 text-blue-500" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/>
|
||||
</svg>
|
||||
Granulare Berechtigungen
|
||||
</label>
|
||||
<div class="space-y-4 p-4 bg-slate-50 dark:bg-slate-800 rounded-xl">
|
||||
<!-- Can Start Jobs -->
|
||||
<div class="flex items-center space-x-3">
|
||||
<input type="checkbox"
|
||||
id="can_start_jobs"
|
||||
name="can_start_jobs"
|
||||
checked
|
||||
class="w-5 h-5 text-blue-600 bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 rounded focus:ring-blue-500 dark:focus:ring-blue-600 focus:ring-2">
|
||||
<label for="can_start_jobs" class="flex-1 cursor-pointer">
|
||||
<div class="font-medium text-slate-900 dark:text-white">Kann Druckaufträge starten</div>
|
||||
<div class="text-sm text-slate-600 dark:text-slate-400">Benutzer kann selbstständig Druckaufträge erstellen und starten</div>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<!-- Needs Approval -->
|
||||
<div class="flex items-center space-x-3">
|
||||
<input type="checkbox"
|
||||
id="needs_approval"
|
||||
name="needs_approval"
|
||||
class="w-5 h-5 text-blue-600 bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 rounded focus:ring-blue-500 dark:focus:ring-blue-600 focus:ring-2">
|
||||
<label for="needs_approval" class="flex-1 cursor-pointer">
|
||||
<div class="font-medium text-slate-900 dark:text-white">Aufträge benötigen Genehmigung</div>
|
||||
<div class="text-sm text-slate-600 dark:text-slate-400">Alle Aufträge dieses Benutzers müssen von einem Ausbilder genehmigt werden</div>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<!-- Can Approve Jobs -->
|
||||
<div class="flex items-center space-x-3">
|
||||
<input type="checkbox"
|
||||
id="can_approve_jobs"
|
||||
name="can_approve_jobs"
|
||||
class="w-5 h-5 text-blue-600 bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 rounded focus:ring-blue-500 dark:focus:ring-blue-600 focus:ring-2">
|
||||
<label for="can_approve_jobs" class="flex-1 cursor-pointer">
|
||||
<div class="font-medium text-slate-900 dark:text-white">Kann Gastanfragen genehmigen</div>
|
||||
<div class="text-sm text-slate-600 dark:text-slate-400">Benutzer kann Gastanfragen bearbeiten und genehmigen/ablehnen</div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Informations-Box -->
|
||||
<div class="info-box-premium rounded-xl p-6 transition-all duration-300">
|
||||
<div class="flex items-start space-x-3">
|
||||
@ -392,6 +441,32 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
roleSelect.addEventListener('change', function() {
|
||||
const roleDescription = document.getElementById('roleDescription');
|
||||
roleDescription.textContent = roleDescriptions[this.value] || roleDescriptions['user'];
|
||||
|
||||
// Bei Admin-Rolle automatisch die Berechtigung zum Genehmigen aktivieren
|
||||
const canApproveCheckbox = document.getElementById('can_approve_jobs');
|
||||
const permissionsSection = document.getElementById('permissionsSection');
|
||||
|
||||
if (this.value === 'admin') {
|
||||
canApproveCheckbox.checked = true;
|
||||
canApproveCheckbox.disabled = true;
|
||||
canApproveCheckbox.parentElement.title = 'Administratoren haben automatisch diese Berechtigung';
|
||||
// Zeige Info, dass Admins alle Berechtigungen haben
|
||||
permissionsSection.querySelector('label').innerHTML = `
|
||||
<svg class="w-4 h-4 inline mr-2 text-blue-500" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/>
|
||||
</svg>
|
||||
Granulare Berechtigungen <span class="text-sm font-normal text-slate-600 dark:text-slate-400">(Administratoren haben automatisch alle Berechtigungen)</span>
|
||||
`;
|
||||
} else {
|
||||
canApproveCheckbox.disabled = false;
|
||||
canApproveCheckbox.parentElement.title = '';
|
||||
permissionsSection.querySelector('label').innerHTML = `
|
||||
<svg class="w-4 h-4 inline mr-2 text-blue-500" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/>
|
||||
</svg>
|
||||
Granulare Berechtigungen
|
||||
`;
|
||||
}
|
||||
});
|
||||
|
||||
// E-Mail-Validierung
|
||||
|
Reference in New Issue
Block a user