mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-02 11:12:20 +08:00
Merge branch 'main' into next
This commit is contained in:
commit
f121895b87
@ -77,13 +77,12 @@ export async function send(this: CustomRequestPlugin, ctx: Context, next: Next)
|
|||||||
|
|
||||||
// root role has all permissions
|
// root role has all permissions
|
||||||
if (ctx.state.currentRole !== 'root') {
|
if (ctx.state.currentRole !== 'root') {
|
||||||
const crRepo = ctx.db.getRepository('customRequestsRoles');
|
const crRepo = ctx.db.getRepository('uiButtonSchemasRoles');
|
||||||
const hasRoles = await crRepo.find({
|
const hasRoles = await crRepo.find({
|
||||||
filter: {
|
filter: {
|
||||||
customRequestKey: filterByTk,
|
uid: filterByTk,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (hasRoles.length) {
|
if (hasRoles.length) {
|
||||||
if (!hasRoles.find((item) => item.roleName === ctx.state.currentRole)) {
|
if (!hasRoles.find((item) => item.roleName === ctx.state.currentRole)) {
|
||||||
return ctx.throw(403, 'custom request no permission');
|
return ctx.throw(403, 'custom request no permission');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user