private static int getUserRoleInCatalog(List perms, CatalogBean catalog,
SessionUserObject user) {
if(catalog==null || user==null || perms==null)
return -1;
for (int i = 0; i < perms.size(); i++) {
CatalogPermBean perm = (CatalogPermBean) perms.get(i);
if (perm.getKey().getCatalog() == catalog.getId()
&& perm.getKey().getUser() == user.getId())
return perm.getRole();
}
return -1;
}