lint for eslint

This commit is contained in:
Michael Shamoon
2022-12-17 20:09:29 -08:00
parent 5e6389fa6e
commit d875d06f37
24 changed files with 79 additions and 74 deletions

View File

@@ -14,12 +14,12 @@ import {
} from '../services/permissions.service'
@Directive({
selector: '[ifObjectPermissions]',
selector: '[appIfObjectPermissions]',
})
export class IfObjectPermissionsDirective implements OnInit, OnChanges {
// The role the user must have
@Input()
ifObjectPermissions: {
appIfObjectPermissions: {
object: ObjectWithPermissions
action: PermissionAction
}
@@ -39,10 +39,10 @@ export class IfObjectPermissionsDirective implements OnInit, OnChanges {
public ngOnInit(): void {
if (
!this.ifObjectPermissions?.object ||
!this.appIfObjectPermissions?.object ||
this.permissionsService.currentUserHasObjectPermissions(
this.ifObjectPermissions.action,
this.ifObjectPermissions.object
this.appIfObjectPermissions.action,
this.appIfObjectPermissions.object
)
) {
if (!this.createdView)

View File

@@ -11,12 +11,12 @@ import { ObjectWithPermissions } from '../data/object-with-permissions'
import { PermissionsService } from '../services/permissions.service'
@Directive({
selector: '[ifOwner]',
selector: '[appIfOwner]',
})
export class IfOwnerDirective implements OnInit, OnChanges {
// The role the user must have
@Input()
ifOwner: ObjectWithPermissions
appIfOwner: ObjectWithPermissions
createdView: EmbeddedViewRef<any>
@@ -32,7 +32,7 @@ export class IfOwnerDirective implements OnInit, OnChanges {
) {}
public ngOnInit(): void {
if (this.permissionsService.currentUserOwnsObject(this.ifOwner)) {
if (this.permissionsService.currentUserOwnsObject(this.appIfOwner)) {
if (!this.createdView)
this.createdView = this.viewContainerRef.createEmbeddedView(
this.templateRef

View File

@@ -12,11 +12,11 @@ import {
} from '../services/permissions.service'
@Directive({
selector: '[ifPermissions]',
selector: '[appIfPermissions]',
})
export class IfPermissionsDirective implements OnInit {
@Input()
ifPermissions:
appIfPermissions:
| Array<{ action: PermissionAction; type: PermissionType }>
| { action: PermissionAction; type: PermissionType }
@@ -34,7 +34,7 @@ export class IfPermissionsDirective implements OnInit {
public ngOnInit(): void {
if (
[]
.concat(this.ifPermissions)
.concat(this.appIfPermissions)
.every((perm: { action: PermissionAction; type: PermissionType }) =>
this.permissionsService.currentUserCan(perm.action, perm.type)
)