|
@ -2,7 +2,11 @@ import { HasPermission } from '@ghostfolio/api/decorators/has-permission.decorat |
|
|
import { HasPermissionGuard } from '@ghostfolio/api/guards/has-permission.guard'; |
|
|
import { HasPermissionGuard } from '@ghostfolio/api/guards/has-permission.guard'; |
|
|
import { PropertyService } from '@ghostfolio/api/services/property/property.service'; |
|
|
import { PropertyService } from '@ghostfolio/api/services/property/property.service'; |
|
|
import { User, UserSettings } from '@ghostfolio/common/interfaces'; |
|
|
import { User, UserSettings } from '@ghostfolio/common/interfaces'; |
|
|
import { hasPermission, permissions } from '@ghostfolio/common/permissions'; |
|
|
import { |
|
|
|
|
|
hasPermission, |
|
|
|
|
|
hasRole, |
|
|
|
|
|
permissions |
|
|
|
|
|
} from '@ghostfolio/common/permissions'; |
|
|
import type { RequestWithUser } from '@ghostfolio/common/types'; |
|
|
import type { RequestWithUser } from '@ghostfolio/common/types'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
@ -59,6 +63,13 @@ export class UserController { |
|
|
public async getUser( |
|
|
public async getUser( |
|
|
@Headers('accept-language') acceptLanguage: string |
|
|
@Headers('accept-language') acceptLanguage: string |
|
|
): Promise<User> { |
|
|
): Promise<User> { |
|
|
|
|
|
if (hasRole(this.request.user, 'INACTIVE')) { |
|
|
|
|
|
throw new HttpException( |
|
|
|
|
|
getReasonPhrase(StatusCodes.TOO_MANY_REQUESTS), |
|
|
|
|
|
StatusCodes.TOO_MANY_REQUESTS |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return this.userService.getUser( |
|
|
return this.userService.getUser( |
|
|
this.request.user, |
|
|
this.request.user, |
|
|
acceptLanguage?.split(',')?.[0] |
|
|
acceptLanguage?.split(',')?.[0] |
|
|