operate时对userRelation判定不严格

This commit is contained in:
Xu Chang 2023-08-24 21:06:23 +08:00
parent 4cae66e429
commit 28f44df68c
2 changed files with 2 additions and 2 deletions

View File

@ -711,7 +711,7 @@ var RelationAuth = /** @class */ (function () {
* @returns
*/
var findOwnCreateUserRelation = function (actionAuths) {
if (userRelations) {
if (userRelations && userRelations.length > 0) {
(0, assert_1.default)(action === 'create');
var ars = actionAuths.filter(function (ar) { return !!userRelations.find(function (ur) { return ur.relationId === ar.relationId; }) && ar.paths.includes('') && ar.destEntity === entity; });
if (ars.length > 0) {

View File

@ -876,7 +876,7 @@ export class RelationAuth<ED extends EntityDict & BaseEntityDict>{
* @returns
*/
const findOwnCreateUserRelation = (actionAuths: ED['actionAuth']['OpSchema'][]) => {
if (userRelations) {
if (userRelations && userRelations.length > 0) {
assert(action === 'create');
const ars = actionAuths.filter(
(ar) => !!userRelations.find(