-2

Currently i have the type of permission on a service and i want to set read-only by path. Is there any way to do it? Something like the auth guard.

Thx

EDIT

Sidebar:

Section1
 link1p
 link2p
Section2
 link1x
 link2x

An example of my database response

Acces: Read
Section: Section1 
subSection: link1p

And now i want disable all forms in this component (link1p) by route, if it possible.

David Rod
  • 11
  • 6

1 Answers1

-1

You can use the data property of the Route interface. You can pass whatever object you like to this, so utilizing it to set a read-only property is easy. Just set it up in your Routes array, then get it from the ActivatedRouteSnapshot whereever you need it

const routes: Routes [
    {
        path: 'myReadOnlyRoute'
        data: { readOnly: true }
    }
]
Bertramp
  • 376
  • 1
  • 15