diff --git a/app/controllers/ProjectEntryController.scala b/app/controllers/ProjectEntryController.scala index 10a542ac..5c3811b8 100644 --- a/app/controllers/ProjectEntryController.scala +++ b/app/controllers/ProjectEntryController.scala @@ -1147,7 +1147,7 @@ class ProjectEntryController @Inject() (@Named("project-creation-actor") project }) }} - def restoreBackup(requestedId: Int, requestedVersion: Int) = IsAdminAsync {uid=>{request=> + def restoreBackup(requestedId: Int, requestedVersion: Int) = IsAuthenticatedAsync {uid=>{request=> implicit val db = dbConfig.db selectid(requestedId).flatMap({ diff --git a/frontend/app/ProjectEntryList/BackupEntry.tsx b/frontend/app/ProjectEntryList/BackupEntry.tsx index 1a0eeba2..6d3ff798 100644 --- a/frontend/app/ProjectEntryList/BackupEntry.tsx +++ b/frontend/app/ProjectEntryList/BackupEntry.tsx @@ -28,7 +28,6 @@ interface BackupEntryProps { filepath: string; version: number; premiereVersion?: number; - isAdmin: boolean; projectId?: number; } @@ -124,48 +123,46 @@ const BackupEntry: React.FC = (props) => { )} - {props.isAdmin ? ( -
- - {/* Confirmation Dialog */} - - - Confirm Project File Restore - - - - - Are you sure you want to restore the project file? - -
- You are about to restore a backed up project file. This action - will overwrite the current file. -
-
-
-
- - - - -
-
- ) : null} +
+ + {/* Confirmation Dialog */} + + + Confirm Project File Restore + + + + + Are you sure you want to restore the project file? + +
+ You are about to restore a backed up project file. This action + will overwrite the current file. +
+
+
+
+ + + + +
+
); }; diff --git a/frontend/app/ProjectEntryList/ProjectBackups.tsx b/frontend/app/ProjectEntryList/ProjectBackups.tsx index 63bb993e..98b31ec0 100644 --- a/frontend/app/ProjectEntryList/ProjectBackups.tsx +++ b/frontend/app/ProjectEntryList/ProjectBackups.tsx @@ -117,7 +117,6 @@ const ProjectBackups: React.FC> = ( const [dialogErrString, setDialogErrString] = useState( undefined ); - const [isAdmin, setIsAdmin] = useState(false); const [primaryFiles, setPrimaryFiles] = useState([]); const [backupFiles, setBackupFiles] = useState([]); const [primaryFileMetadata, setPrimaryFileMetadata] = useState< @@ -169,19 +168,6 @@ const ProjectBackups: React.FC> = ( } }, [project]); - const fetchWhoIsLoggedIn = async () => { - try { - const loggedIn = await isLoggedIn(); - setIsAdmin(loggedIn.isAdmin); - } catch { - setIsAdmin(false); - } - }; - - useEffect(() => { - fetchWhoIsLoggedIn(); - }, []); - return ( <> {project ? ( @@ -243,7 +229,6 @@ const ProjectBackups: React.FC> = ( filepath={f.filepath} version={f.version} premiereVersion={f.premiereVersion} - isAdmin={isAdmin} projectId={project?.id} /> ))}