2
I am developing a system where depending on the level of the user it is redirected to a page
.run(function($rootScope, $location, $http, config) {
$rootScope.$on('$locationChangeStart', function(event) {
if ($location.path() != "/Login") {
$http.get(config.BaseUrl + "/auth.php").success(function(inf) {
if (typeof inf == "object") {
if (inf.nivel > 0) {
$location.path("/ContratosCorretor") ;
}
That is, if the user level is higher than 0, he is a broker and will be redirected to his page, but he will be able to access another page
$routeProvider.when("/NovoContratoCorretor", {
templateUrl: "view/NovoContratoCorretor.html",
controller: "NovoContratoCorretor",
})
and that way it’s my $rootscope and will always be directed to /ContratosCorretor
.. Does anyone have a solution to this problem?
If I understand well what you want to do, depending on the level of access the user is redirected to a page is this?
– Emir Marques
That, depending on his level, he’s redirected to a page, but he can only access that page... I want him to be able to access one more
– Luiz Fábio
The user only gets stuck on that page, but I want him to be able to browse through one more
– Luiz Fábio
In this case, I understand that when the user accesses the first time will be redirected to a default page. Then he can navigate between pages through a I believe menu. Is that it? If yes what you need is a dynamic menu that is compiled at runtime according to the user’s level. Right?
– Emir Marques