Function: canUserMigrateRecord()
canUserMigrateRecord(
recordUri,recordOwnerDid,currentUserDid):boolean
Defined in: web/lib/hooks/use-schema-migration.ts:326
Checks if the current user can migrate a record.
Parameters
recordUri
string
AT-URI of the record
recordOwnerDid
string
DID of the record owner (submittedBy or paperDid)
currentUserDid
DID of the current authenticated user
undefined | string
Returns
boolean
True if the user can migrate the record
Remarks
A user can migrate a record if:
- They are authenticated
- They own the record (their DID matches the record's submittedBy or paperDid)
Example
const canMigrate = canUserMigrateRecord(
eprint.uri,
eprint.submittedBy,
currentUser?.did
);