import { Injectable } from '@angular/core' ; import { Observable } from 'rxjs/Observable' ; import { PortalService } from './portal.service' ; import 'rxjs/add/operator/map' ; export interface IAuthzService { hasPermission ( resourceId , requestedActions ) : Observable < boolean > ; hasReadOnlyLock ( resourceId ) : Observable < boolean > ; } @ Injectable ( ) export class AuthzService implements IAuthzService { public static readScope = './read' ; public static writeScope = './write' ; public static deleteScope = './delete' ; public static actionScope = './action' ; public static slotswapScope = './slotsswap/action' ; public static applySlotConfigScope = './applySlotConfig/action' ; public static resetSlotConfigScope = './resetSlotConfig/action' ; public static activeDirectoryWriteScope = 'Microsoft.Authorization/*/Write' ; public static websiteContributorScope = 'Microsoft.web/sites/*' ; constructor ( private _portalService ) { } hasPermission ( resourceId , requestedActions ) { return this . _portalService . hasPermission ( resourceId , requestedActions ) ; } hasReadOnlyLock ( resourceId ) { return this . _portalService . hasLock ( resourceId , 'ReadOnly' ) ; } }