try {
Identity.instance().checkPermission( new PackageNameType( asset.getPackage().getName() ),
RoleTypes.PACKAGE_DEVELOPER );
} catch ( RuntimeException e ) {
if ( asset.getCategories().size() == 0 ) {
Identity.instance().checkPermission( new CategoryPathType( null ),
RoleTypes.ANALYST );
} else {
RuntimeException exception = null;
for ( CategoryItem cat : asset.getCategories() ) {
try {
Identity.instance().checkPermission( new CategoryPathType( cat.getFullPath() ),
RoleTypes.ANALYST );
passed = true;
} catch ( RuntimeException re ) {
exception = re;
}