- private init () {
- // Convert possible markdown to html
- const html = this.linkifierService.linkify(this.comment.text)
-
- this.sanitizedCommentHTML = sanitizeHtml(html, {
- allowedTags: [ 'a', 'p', 'span', 'br' ],
- allowedSchemes: [ 'http', 'https' ],
- allowedAttributes: {
- 'a': [ 'href', 'class', 'target' ]
- },
- transformTags: {
- a: (tagName, attribs) => {
- return {
- tagName,
- attribs: Object.assign(attribs, {
- target: '_blank'
- })
- }
- }
- }
- })
+ private getUserIfNeeded (account: Account) {
+ if (!account.userId) return
+ if (!this.authService.isLoggedIn()) return
+
+ const user = this.authService.getUser()
+ if (user.hasRight(UserRight.MANAGE_USERS)) {
+ this.userService.getUserWithCache(account.userId)
+ .subscribe(
+ user => this.commentUser = user,
+
+ err => this.notifier.error(err.message)
+ )
+ }
+ }