Hello all,
I have a custom layout accessible by URL and i like to restrict the access to this layout for custom role or only for admin users.
How can i do that?
Thanks!
Hello all,
I have a custom layout accessible by URL and i like to restrict the access to this layout for custom role or only for admin users.
How can i do that?
Thanks!
Hi Diego Celdrán,
You can always check app.user object to get the current user ACL or type.
For eg: to check if current user is admin: isSysAdmin = (app.user.get('type') == 'admin');
to get current user ACLs: console.log(app.user.getAcls());
You can use either of these methods in your layout controller initialize function and load no-access view or desired view based on user's access level.
Let us know if this helps.
Regards.
Hats
Hi Diego Celdrán,
You can always check app.user object to get the current user ACL or type.
For eg: to check if current user is admin: isSysAdmin = (app.user.get('type') == 'admin');
to get current user ACLs: console.log(app.user.getAcls());
You can use either of these methods in your layout controller initialize function and load no-access view or desired view based on user's access level.
Let us know if this helps.
Regards.
Hats