change source of account id in prepared token to domain account id, create consumer salesInvoiceModule
This commit is contained in:
@@ -60,7 +60,7 @@ export class PosGuard implements CanActivate {
|
||||
user: {
|
||||
accounts: {
|
||||
some: {
|
||||
account_id: account.account_id,
|
||||
id: account.account_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -81,20 +81,16 @@ export class PosGuard implements CanActivate {
|
||||
throw new ForbiddenException('شما دسترسی لازم را ندارید.')
|
||||
}
|
||||
|
||||
const foundedAccount = await this.prisma.account.findUnique({
|
||||
const foundedAccount = await this.prisma.consumerAccount.findUnique({
|
||||
where: {
|
||||
id: account.account_id,
|
||||
},
|
||||
select: {
|
||||
consumer_account: {
|
||||
select: {
|
||||
role: true,
|
||||
},
|
||||
},
|
||||
role: true,
|
||||
},
|
||||
})
|
||||
|
||||
if (foundedAccount?.consumer_account?.role === 'OWNER') {
|
||||
if (foundedAccount?.role === 'OWNER') {
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user