mirror of
https://github.com/xuthus83/pigallery2.git
synced 2025-01-14 14:43:17 +08:00
test fix
This commit is contained in:
parent
4891eed7b3
commit
f99e13f3fc
@ -1,7 +1,8 @@
|
|||||||
import {UserDTO, UserRoles} from '../../../../common/entities/UserDTO';
|
import {UserDTO, UserRoles} from '../../../../common/entities/UserDTO';
|
||||||
import {Column, Entity, PrimaryGeneratedColumn} from 'typeorm';
|
import {Column, Entity, PrimaryGeneratedColumn, Unique} from 'typeorm';
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
|
@Unique(['name'])
|
||||||
export class UserEntity implements UserDTO {
|
export class UserEntity implements UserDTO {
|
||||||
|
|
||||||
@PrimaryGeneratedColumn()
|
@PrimaryGeneratedColumn()
|
||||||
|
@ -27,6 +27,9 @@ export module UserDTO {
|
|||||||
}
|
}
|
||||||
for (let i = 0; i < permissions.length; i++) {
|
for (let i = 0; i < permissions.length; i++) {
|
||||||
let permission = permissions[i];
|
let permission = permissions[i];
|
||||||
|
if (permissions[i] === separator + '*') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (permission[permission.length - 1] === '*') {
|
if (permission[permission.length - 1] === '*') {
|
||||||
permission = permission.slice(0, -1);
|
permission = permission.slice(0, -1);
|
||||||
if (path.startsWith(permission) && (!path[permission.length] || path[permission.length] === separator)) {
|
if (path.startsWith(permission) && (!path[permission.length] || path[permission.length] === separator)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user