Add RBAC check to openEditProjectModal
1 file changed+4−0
index.html+4−0View file
| @@ -4051,6 +4051,10 @@ | ||
| // Modal: Edit Project | ||
| function openEditProjectModal(projectId) { | ||
| + if (!currentUser || currentUser.role !== 'admin') { | ||
| + showToast('Access Denied', 'Administrator permissions required.', 'error'); | ||
| + return; | ||
| + } | ||
| const p = state.projects.find(x => x._id === projectId); | ||
| if (!p) return; | ||
| document.getElementById('edit-project-id').value = p._id; | ||