@ SuppressWarnings ( "unchecked" ) public boolean hasPermission ( Authentication authentication , Serializable resource , String resourceType , Object privilege ) { boolean logPermission = isLogPermission ( resource ) ; if ( checkRole ( authentication , privilege , logPermission ) ) { return true ; } if ( resource != null ) { Object resourceId = ( ( Map < String , Object > ) resource ) . get ( "id" ) ; if ( resourceId != null ) { ( ( Map < String , Object > ) resource ) . put ( resourceType , resourceFactory . getResource ( resourceId , resourceType ) ) ; } } return checkPermission ( authentication , resource , privilege , true , logPermission ) ; }
Check permission for role privilege key new resource and old resource .