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