Fix for CI build failure.
This commit is contained in:
parent
b9ce140d95
commit
4300e5c733
2 changed files with 2 additions and 2 deletions
|
@ -181,7 +181,7 @@ export function generateUserMetadataID(globalId: string) {
|
||||||
/**
|
/**
|
||||||
* Breaks up the ID to get the global ID.
|
* 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}`
|
const prefix = `${DocumentType.ROW}${SEPARATOR}${InternalTable.USER_METADATA}${SEPARATOR}`
|
||||||
if (!id || !id.includes(prefix)) {
|
if (!id || !id.includes(prefix)) {
|
||||||
return id
|
return id
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { BBContext, User } from "@budibase/types"
|
||||||
|
|
||||||
function isLoggedInUser(ctx: BBContext, user: User) {
|
function isLoggedInUser(ctx: BBContext, user: User) {
|
||||||
const loggedInId = ctx.user?._id
|
const loggedInId = ctx.user?._id
|
||||||
const globalUserId = dbCore.getGlobalIDFromUserMetadataID(loggedInId)
|
const globalUserId = dbCore.getGlobalIDFromUserMetadataID(loggedInId!)
|
||||||
// check both just incase
|
// check both just incase
|
||||||
return globalUserId === user._id || loggedInId === user._id
|
return globalUserId === user._id || loggedInId === user._id
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue