Project

General

Profile

Cleanup #47355

mgr/dashboard: create directive for AuthStorage service

Added by Ernesto Puerta 5 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
dashboard/auth-sso
Target version:
% Done:

0%

Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

Right now, if a component wants to conditionally display its elements based on authorization/scopes criteria, it has to embed direct calls to the AuthService. That basically causes a tight coupling between components and the AuthStorage API (localStorage based).

By using a simple directive, we can move all references to AuthStorage to the HTML template, leave a cleaner component logic (no intermixed AuthStorage calls), and simplify unit tests (no need of 'mocking' auth/localstorage, just a directive).

Also available in: Atom PDF