Fix for CI build failure.
This commit is contained in:
parent
9608b74920
commit
b68c3c8481
|
@ -181,7 +181,7 @@ export function generateUserMetadataID(globalId: string) {
|
|||
/**
|
||||
* Breaks up the ID to get the global ID.
|
||||
*/
|
||||
export function getGlobalIDFromUserMetadataID(id?: string) {
|
||||
export function getGlobalIDFromUserMetadataID(id: string) {
|
||||
const prefix = `${DocumentType.ROW}${SEPARATOR}${InternalTable.USER_METADATA}${SEPARATOR}`
|
||||
if (!id || !id.includes(prefix)) {
|
||||
return id
|
||||
|
|
|
@ -11,7 +11,7 @@ import { BBContext, User } from "@budibase/types"
|
|||
|
||||
function isLoggedInUser(ctx: BBContext, user: User) {
|
||||
const loggedInId = ctx.user?._id
|
||||
const globalUserId = dbCore.getGlobalIDFromUserMetadataID(loggedInId)
|
||||
const globalUserId = dbCore.getGlobalIDFromUserMetadataID(loggedInId!)
|
||||
// check both just incase
|
||||
return globalUserId === user._id || loggedInId === user._id
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue