Merge branch '16437-indicate-when-projects-are-not-editable-by-user'
[arvados.git] / src / models / resource.ts
index 239a67cc1251e88d6b6968c89a7d9b878ac9b214..d8cdd4a00503ef2e86b9bd846193cd8750f525b3 100644 (file)
@@ -14,6 +14,10 @@ export interface Resource {
     etag: string;
 }
 
+export interface EditableResource extends Resource {
+    isEditable: boolean;
+}
+
 export interface TrashableResource extends Resource {
     trashAt: string;
     deleteAt: string;
@@ -58,8 +62,8 @@ export enum ResourceObjectType {
 }
 
 export const RESOURCE_UUID_PATTERN = '[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{15}';
-export const RESOURCE_UUID_REGEX = new RegExp(RESOURCE_UUID_PATTERN);
-export const COLLECTION_PDH_REGEX = /[a-f0-9]{32}\+\d+/;
+export const RESOURCE_UUID_REGEX = new RegExp("^" + RESOURCE_UUID_PATTERN + "$");
+export const COLLECTION_PDH_REGEX = /^[a-f0-9]{32}\+\d+$/;
 
 export const isResourceUuid = (uuid: string) =>
     RESOURCE_UUID_REGEX.test(uuid);