{"version":3,"file":"cccteam-ccc-lib-auth-authorization-guard.mjs","sources":["../../../projects/ccc-lib/auth-authorization-guard/authorization.guard.ts","../../../projects/ccc-lib/auth-authorization-guard/cccteam-ccc-lib-auth-authorization-guard.ts"],"sourcesContent":["import { inject } from '@angular/core';\nimport { ActivatedRouteSnapshot, CanActivateFn, Router } from '@angular/router';\nimport { AuthService } from '@cccteam/ccc-lib/auth-service';\n\nexport const AuthorizationGuard: CanActivateFn = (route: ActivatedRouteSnapshot) => {\n  const router = inject(Router);\n  const auth = inject(AuthService);\n\n  const hasPermission = auth.hasPermission(route.data['scope']);\n  if (hasPermission) {\n    return true;\n  }\n\n  return router.createUrlTree(['/']);\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAIO,MAAM,kBAAkB,GAAkB,CAAC,KAA6B,KAAI;AACjF,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAC7B,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC;AAEhC,IAAA,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7D,IAAI,aAAa,EAAE;AACjB,QAAA,OAAO,IAAI;IACb;IAEA,OAAO,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC;AACpC;;ACdA;;AAEG;;;;"}