Good afternoon, I'm developing a registration system with angularJS and C #, when registering a new user there are two types of users to choose, administrator and librarian, being administrator type 1 and librarian type 2. and a menu with the following options: condominium, book, resident and user, when a librarian type user logs that the condominium option is not present in the menu, I have already created a method for this, however I would like to know how to use it together with the html menu
Method code:
public void UserType(string usuario)
{
var db = new CRMEntities();
object user;
try
{
user = db.Usuario.Where(p => p.usuario1 == usuario).FirstOrDefault();
}
catch (Exception ex)
{
user = null;
}
var returnJson = "";
if (user == null)
returnJson = JsonConvert.SerializeObject(null);
else
returnJson = JsonConvert.SerializeObject(((Usuario)user).grupoUsuario);
ReturnJson(returnJson);
}
Menu Code:
<ul class="nav" id="side-menu">
<li>
<a href="#!/"><span class="nav-label">Painel</span><span class="fa arrow"></span> </a>
</li>
<li>
<a href="#"><span class="nav-label">Cadastro</span><span class="fa arrow"></span> </a>
<ul class="nav nav-second-level">
<li><a href="#!/condominio">Condomínio</a></li>
<li><a href="#!/livro">Livro</a></li>
<li><a href="#!/morador">Morador</a></li>
<li><a href="#!/usuario">Usuário</a></li>
</ul>
</li>
</ul>
<script>
$(document).ready(function () {
$('#side-menu').metisMenu();
});
</script>