identity.isLoggedIn(true);
Class beanClass = PersistenceProvider.instance().getBeanClass(entity);
Restrict restrict = null;
if (m != null && m.isAnnotationPresent(Restrict.class))
{
restrict = m.getAnnotation(Restrict.class);
}
else if (entity.getClass().isAnnotationPresent(Restrict.class))
{
restrict = entity.getClass().getAnnotation(Restrict.class);
}
if (restrict != null)
{
if (Strings.isEmpty(restrict.value()))
{
String name = Seam.getComponentName(beanClass);
if (name == null)
{
name = beanClass.getName();
}
Identity.instance().checkPermission(name, action.toString(), entity);
}
else
{
Identity.instance().checkRestriction(restrict.value());
}
}
}
}