ng-admin-demo
ng-admin-demo copied to clipboard
ng-admin role-based system
Hi. I've found the tweak for creating ability for role-based access to different parts of functionality in admin. Without any changes in admin-config or ng-admin core repository. Role-based access can be achieved using different configurations for different roles. Naive demo uses simple localStorage without any providers.
if ($window.$get().localStorage.getItem('posters_galore_login') == 'admin') {
//admin config
} else {
//user config
}
That's not a hack, that's the simple way to handle roles in ng-admin!
Unless I'm missing something, this is certainly a hack.
The problem is that you don't know that the user is an admin or not until the app is running at which point ng-admin has already been set up in the controller. So you need to reload the app after log in, and saving the state which is ugly. Same on log out.
Can you plz help me to get the input box on my listview