mirror of
				https://github.com/inventree/inventree-app.git
				synced 2025-11-03 23:05:44 +00:00 
			
		
		
		
	Reduce error reporting on permission check errors
This commit is contained in:
		@@ -488,7 +488,16 @@ class InvenTreeAPI {
 | 
				
			|||||||
      List<String> perms = List.from(roles[role] as List<dynamic>);
 | 
					      List<String> perms = List.from(roles[role] as List<dynamic>);
 | 
				
			||||||
      return perms.contains(permission);
 | 
					      return perms.contains(permission);
 | 
				
			||||||
    } catch (error, stackTrace) {
 | 
					    } catch (error, stackTrace) {
 | 
				
			||||||
 | 
					      if (error is CastError) {
 | 
				
			||||||
 | 
					        // Ignore CastError
 | 
				
			||||||
 | 
					      } else if (error is TypeError) {
 | 
				
			||||||
 | 
					        // Ignore TypeError
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        // Unknown error - report it!
 | 
				
			||||||
        sentryReportError(error, stackTrace);
 | 
					        sentryReportError(error, stackTrace);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      // Unable to determine permission - assume true?
 | 
				
			||||||
      return true;
 | 
					      return true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user